Files
Main/Assets/Launcher/ExternalLibs/TimelineTrack/ScriptActivationTrack/ScriptActivationClip.cs

32 lines
976 B
C#
Raw Normal View History

2025-01-25 04:38:09 +08:00
using System;
using UnityEngine;
using UnityEngine.Playables;
namespace Thousandto.Launcher.ExternalLibs
{
[Serializable]
public class ScriptActivationClip : PlayableAsset
{
public string BehaviourName;
public bool NeedSendMessage;
public int IntParam;
public string StrParam;
private ScriptActivationBehaviour template = new ScriptActivationBehaviour();
public override Playable CreatePlayable(PlayableGraph graph, GameObject owner)
{
var playable = ScriptPlayable<ScriptActivationBehaviour>.Create(graph, template);
var behaviour = playable.GetBehaviour();
if (behaviour != null)
{
behaviour.ScriptName = BehaviourName;
behaviour.NeedSendMessage = NeedSendMessage;
behaviour.IntParam = IntParam;
behaviour.StrParam = StrParam;
}
return playable;
}
}
}