using NodeCanvas.Framework; using ParadoxNotion.Design; using UnityEngine; namespace NodeCanvas.Tasks.Actions { [Category("GameObject")] public class GetComponent : ActionTask where T : Component { [BlackboardOnly] public BBParameter saveAs; protected override string info { get { return string.Format("Get {0} as {1}", typeof(T).Name, saveAs.ToString()); } } protected override void OnExecute() { var o = agent.GetComponent(); saveAs.value = o; EndAction(o != null); } } }