32 lines
976 B
C#
32 lines
976 B
C#
|
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;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|