using NodeCanvas.Framework; using ParadoxNotion.Design; using UnityEngine; namespace NodeCanvas.Tasks.Actions { [Name("Set Look At")] [Category("Animator")] public class MecanimSetLookAt : ActionTask { public BBParameter targetPosition; public BBParameter targetWeight; protected override string info { get { return "Mec.SetLookAt " + targetPosition; } } protected override void OnExecute() { router.onAnimatorIK += OnAnimatorIK; } protected override void OnStop() { router.onAnimatorIK -= OnAnimatorIK; } void OnAnimatorIK(ParadoxNotion.EventData msg) { agent.SetLookAtPosition(targetPosition.value.transform.position); agent.SetLookAtWeight(targetWeight.value); EndAction(); } } }