//Update for idle state //Changes to movement if movement vector is not 0 void UpdateIdle() { if (Vector3.zero != m_v3Movement) { ECurrState = EMovingStates.eMove; } }
//Update for move state //Becomes idle is movement vector is small enough void UpdateMove() { if (Vector3.zero == m_v3Movement) { ECurrState = EMovingStates.eIdle; } Move(); }
// Use this for initialization void Start() { eCurrState = EMovingStates.eIdle; m_v3Movement = Vector3.zero; m_rbOwnBody = this.GetComponent <Rigidbody>(); m_trOwnTransform = this.GetComponent <Transform>(); SetUpStateMachine(); }