// Update is called once per frame void Update() { switch (currentState) { case stateMachine.Idle: m_Idle.Execute(this.gameObject); break; case stateMachine.Move: m_Move.Execute(this.gameObject); break; case stateMachine.Attack: m_Attack.Execute(this.gameObject); break; case stateMachine.Death: m_Death.Execute(this.gameObject); break; } }