24 lines
652 B
C#
24 lines
652 B
C#
|
using System.Collections;
|
||
|
using System.Collections.Generic;
|
||
|
using NodeCanvas.DialogueTrees;
|
||
|
using UnityEngine;
|
||
|
using UnityEngine.Playables;
|
||
|
using UnityEngine.Timeline;
|
||
|
|
||
|
namespace BITKit.Timeline
|
||
|
{
|
||
|
public class DialogueClip : PlayableAsset
|
||
|
{
|
||
|
[SerializeField] private string subtitle;
|
||
|
|
||
|
public override Playable CreatePlayable(PlayableGraph graph, GameObject owner)
|
||
|
{
|
||
|
var playable = ScriptPlayable<DialogueBehaviour>.Create(graph);
|
||
|
var behaviour = playable.GetBehaviour();
|
||
|
behaviour.duration = playable.GetDuration();
|
||
|
behaviour.subtitle = subtitle;
|
||
|
behaviour.actor = owner.GetComponent<DialogueActor>();
|
||
|
return playable;
|
||
|
}
|
||
|
}
|
||
|
}
|