//********************ANIMATION************************** public void ApplyAnimation() { if (!Input.GetKey(KeyCode.LeftShift) && movementState != E_MOVE_STATE.STILL) { animState = E_ANIM_STATE.WALK; SetAnimatorState(E_ANIM_STATE.WALK); } if (Input.GetKey(KeyCode.LeftShift) && canRun && movementState != E_MOVE_STATE.STILL) { animState = E_ANIM_STATE.RUN; SetAnimatorState(E_ANIM_STATE.RUN); } if (movementState == E_MOVE_STATE.STILL) { animState = E_ANIM_STATE.IDLE; SetAnimatorState(E_ANIM_STATE.IDLE); } }
public void SetAnimatorState(E_ANIM_STATE _state) { if (_state == E_ANIM_STATE.RUN) { animator.SetBool("run", true); animator.SetBool("walk", false); } else if (_state == E_ANIM_STATE.WALK) { animator.SetBool("walk", true); animator.SetBool("run", false); } else if (_state == E_ANIM_STATE.IDLE) { animator.SetBool("run", false); animator.SetBool("walk", false); } else if (_state == E_ANIM_STATE.DIE) { animator.SetBool("run", false); animator.SetBool("walk", false); animator.SetBool("death", true); } }
//*****************GET*********************** //*****************SET*********************** void SetState(E_ANIM_STATE _state) { state = _state; }
public void SetAnimationState(E_ANIM_STATE State) { testPINVOKE.CGameObject_SetAnimationState(swigCPtr, (int)State); }