public override void OnEnter(MoonAI ai) { velocity = Vector3.zero; agent = ai.GetComponent <NavMeshAgent>(); speed = Speed.GetValue <float>(ai.Memory); TargetGo = ai.Memory.GetValue <GameObject>(Target.key); }
public override void OnEnter(MoonAI ai) { DetectSomething = false; Running = false; DetectSelf = _DetectSelf.GetValue <bool>(ai.Memory); SearchTag = _SearchTag.GetValue <string>(ai.Memory); SaveName = _SaveName.GetValue <string>(ai.Memory); ResetOnExit = _ResetOnExitSensor.GetValue <bool>(ai.Memory); string SensorName = _SensorName.GetValue <string>(ai.Memory); if (!string.IsNullOrEmpty(SensorName)) { if (!ai.GetComponent <MoonPerception>()) { Debug.LogError("[MoonBehavior] No MoonPerception component detected! aborting."); return; } Vision = ai.GetComponent <MoonPerception>().GetSensor(SensorName) as VisualSensor; } }
public override TaskResult OnExecute(MoonAI ai) { Animator anim = ai.GetComponent <Animator>(); string _param = Parameter.GetValue <string>(ai.Memory); if (anim != null && !string.IsNullOrEmpty(_param)) { anim.SetTrigger(_param); return(TaskResult.Success); } return(TaskResult.Failure); }
public override void OnEnter(MoonAI ai) { anim = ai.GetComponent <Animator>(); }
public override void OnEnter(MoonAI ai) { Mem = ai.GetComponent <MoonMemory>(); }
public override void OnEnter(MoonAI ai) { Mem = ai.GetComponent <MoonMemory>(); Agent = ai.GetComponent <NavMeshAgent>(); }