using NodeCanvas.Framework; using ParadoxNotion.Design; using UnityEngine; namespace NodeCanvas.Tasks.Actions { [Category("GameObject")] public class GetDistance : ActionTask { [RequiredField] public BBParameter target; [BlackboardOnly] public BBParameter saveAs; protected override string info { get { return string.Format("Get Distance to {0}", target.ToString()); } } protected override void OnExecute() { saveAs.value = Vector3.Distance(agent.position, target.value.transform.position); EndAction(); } } }