public GStateData(GFSM controller, NavMeshAgent agent, Transform targetTransform, Animator anim, string animationClip, float transitionTime) { this.controller = controller; this.agent = agent; this.targetLocation = null; this.targetTransform = targetTransform; this.anim = anim; this.animationClip = animationClip; this.transitionTime = transitionTime; }
private void OnValidate() { if (agent == null) { agent = GetComponent <NavMeshAgent>(); } if (controller == null) { controller = GetComponent <GFSM>(); } }
public GState(GStateData data) { //anim.ResetTrigger(animationClip); this.animationClip = data.animationClip; this.anim = data.anim; this.controller = data.controller; this.agent = data.agent; this.targetLocation = data.targetLocation; this.targetTransform = data.targetTransform; this.transitionTime = data.transitionTime; stateStage = EVENT.ENTER; }