浏览代码

Change events on the Dialogue track, instead of the dialogue clip

/main
uChema 4 年前
当前提交
f72f481b
共有 3 个文件被更改,包括 12 次插入2 次删除
  1. 4
      UOP1_Project/Assets/Scripts/Cutscenes/DialogueControlTrack/DialogueBehaviour.cs
  2. 6
      UOP1_Project/Assets/Scripts/Cutscenes/DialogueControlTrack/DialogueClip.cs
  3. 4
      UOP1_Project/Assets/Scripts/Cutscenes/DialogueControlTrack/DialogueTrack.cs

4
UOP1_Project/Assets/Scripts/Cutscenes/DialogueControlTrack/DialogueBehaviour.cs


[SerializeField] private bool _pauseWhenClipEnds = default; //This won't work if the clip ends on the very last frame of the Timeline
[SerializeField] public DialogueLineChannelSO PlayDialogueEvent;
[SerializeField] public VoidEventChannelSO PauseTimelineEvent;
[HideInInspector] public DialogueLineChannelSO PlayDialogueEvent;
[HideInInspector] public VoidEventChannelSO PauseTimelineEvent;
private bool _dialoguePlayed;

6
UOP1_Project/Assets/Scripts/Cutscenes/DialogueControlTrack/DialogueClip.cs


{
[SerializeField] private DialogueBehaviour _template = default;
[HideInInspector] public DialogueLineChannelSO PlayDialogueEvent;
[HideInInspector] public VoidEventChannelSO PauseTimelineEvent;
// Having ClipCaps set to None makes sure that the clips can't be blended, extrapolated, looped, etc.
public ClipCaps clipCaps
{

public override Playable CreatePlayable(PlayableGraph graph, GameObject owner)
{
ScriptPlayable<DialogueBehaviour> playable = ScriptPlayable<DialogueBehaviour>.Create(graph, _template);
_template.PlayDialogueEvent = PlayDialogueEvent;
_template.PauseTimelineEvent = PauseTimelineEvent;
return playable;
}

4
UOP1_Project/Assets/Scripts/Cutscenes/DialogueControlTrack/DialogueTrack.cs


[TrackClipType(typeof(DialogueClip))]
public class DialogueTrack : PlayableTrack
{
[SerializeField] public DialogueLineChannelSO PlayDialogueEvent;
[SerializeField] public VoidEventChannelSO PauseTimelineEvent;
public override Playable CreateTrackMixer(PlayableGraph graph, GameObject go, int inputCount)
{

dialogueControlClip.PauseTimelineEvent = PauseTimelineEvent;
dialogueControlClip.PlayDialogueEvent = PlayDialogueEvent;
}
return base.CreateTrackMixer(graph, go, inputCount);
正在加载...
取消
保存