1
0
Fork 0
LaboratoryProtection/Assets/OtherPackage/DefaultPlayables/NavMeshAgentControl/NavMeshAgentControlClip.cs

26 lines
784 B
C#
Raw Normal View History

2023-09-12 15:55:51 +08:00
using System;
using UnityEngine;
using UnityEngine.Playables;
using UnityEngine.Timeline;
[Serializable]
public class NavMeshAgentControlClip : PlayableAsset, ITimelineClipAsset
{
public ExposedReference<Transform> destination;
[HideInInspector]
public NavMeshAgentControlBehaviour template = new NavMeshAgentControlBehaviour ();
public ClipCaps clipCaps
{
get { return ClipCaps.None; }
}
public override Playable CreatePlayable (PlayableGraph graph, GameObject owner)
{
var playable = ScriptPlayable<NavMeshAgentControlBehaviour>.Create (graph, template);
NavMeshAgentControlBehaviour clone = playable.GetBehaviour ();
clone.destination = destination.Resolve (graph.GetResolver ());
return playable;
}
}