void Awake() { IdleState = this.GetComponent <Leader_IdleState>(); WalkingState = this.GetComponent <Leader_WalkingState>(); InteractiveState = this.GetComponent <Leader_InteractiveState>(); SaluteState = this.GetComponent <Leader_SaluteState>(); ShakeHandsState = this.GetComponent <Leader_ShakeHandsState>(); SpeechState = this.GetComponent <Leader_SpeechState>(); WaveHandState = this.GetComponent <Leader_WaveHandState>(); WaitingState = this.GetComponent <Leader_WaitingState>(); AfterSpeechState = this.GetComponent <Leader_AfterSpeechState>(); CloseToPlayerState = this.GetComponent <Leader_CloseToPlayerState>(); ReturnToPathState = this.GetComponent <Leader_ReturnToPathState>(); }
// OnStateEnter is called when a transition starts and the state machine starts to evaluate this state override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { base.OnStateEnter(animator, stateInfo, layerIndex); interactiveStateOfLeader = GameObject.FindGameObjectWithTag(Tags.Leader).GetComponent <Leader>().States.InteractiveState; timer = 0.0f; }