您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
29 行
648 B
29 行
648 B
using System;
|
|
using UnityEngine;
|
|
using UnityEngine.Playables;
|
|
using UnityEngine.Timeline;
|
|
using UnityEngine.UI;
|
|
|
|
[Serializable]
|
|
public class CommandBehaviour : PlayableBehaviour
|
|
{
|
|
public string commandAtStart;
|
|
|
|
bool triggered = false;
|
|
|
|
public override void OnGraphStart(Playable playable)
|
|
{
|
|
triggered = false;
|
|
base.OnGraphStart(playable);
|
|
}
|
|
|
|
public override void OnBehaviourPlay(Playable playable, FrameData info)
|
|
{
|
|
base.OnBehaviourPlay(playable, info);
|
|
if(!triggered)
|
|
{
|
|
triggered = true;
|
|
Console.EnqueueCommandNoHistory(commandAtStart);
|
|
}
|
|
}
|
|
}
|