コード例 #1
0
 public void setAnimation(ANIMATOR animator)
 {
     if(animator.Equals(ANIMATOR.HIT))
     {
         this.animation.SetTrigger("Hit");
     }
 }
コード例 #2
0
 private void setLocomotionValue()
 {
     ANIMATOR.SetFloat("horizontal", mInputHorizontal);
     ANIMATOR.SetFloat("vertical", mInputVertical);
     ANIMATOR.SetFloat("forwardX", transform.forward.x);
     ANIMATOR.SetFloat("forwardZ", transform.forward.z);
     ANIMATOR.SetFloat("directionX", mDirection.x);
     ANIMATOR.SetFloat("directionZ", mDirection.z);
 }
コード例 #3
0
    void ChangeAnimation()
    {
        if (ANIMATOR == null)
        {
            Debug.LogError(SelfObject.name + " 에게 Animator가 없습니다.");
            return;
        }

        ANIMATOR.SetInteger("State", (int)CurrentAIState);
    }
コード例 #4
0
 void ChangeAnimation()
 {
     if (ANIMATOR == null)
     {
         Debug.LogError(gameObject.name + " 에게 Animator가 없습니다.");
         return;
     }
     //은기 에니메이션 상태 확인 로그 추가
     //Debug.Log("현재 애니메이션 상태는"+CurrentState + " 입니다.");
     ANIMATOR.SetInteger("State", (int)CurrentState);
     //	Debug.Log(CurrentState);
 }
コード例 #5
0
        private void handleState()
        {
            //LOGGER.logTag("y", skeleton.transform.position.y.ToString());
            AnimatorStateInfo info = ANIMATOR.GetCurrentAnimatorStateInfo(0);

            mCurrentBaseState = info.fullPathHash;
            if (mScalableSpeed.SPEED <= 0.0f)
            {
                if (mCurrentBaseState == idleState)
                {
                    mStateMachine.onIdle();
                }
                else if (mCurrentBaseState == jumpState)
                {
                    mStateMachine.onJump();
                }
            }

            if (mCurrentBaseState != jumpState)
            {
                JUMP = mOnJump;
            }
            else
            {
                mOnJump = false;
                //float colliderHeight = mAnimator.GetFloat("ColliderHeight");
                //float h = transform.position.y + colliderHeight;
                //LOGGER.logTag("ColliderHeight", colliderHeight);
                //LOGGER.logTag("x", skeleton.transform.position.x);

                //LOGGER.logTag("z", skeleton.transform.position.z);
                //LOGGER.logTag("h", h);

                //Vector3 center = mCharacterController.transform.localPosition;
                //center = new Vector3(center.x, h, center.z);
                // mCharacterController.transform.localPosition = center;
            }
            mStateMachine.handleUpdate();
        }