예제 #1
0
        public void Standing()
        {
            if (actualState == States.Standing)
                return;

            if (actualState == States.Jumping)
                return;
            //if (actualState == States.Kicked)
            //    return;
            if (actualState == States.Falling)
                return;
            if (actualState == States.BadJump)
                return;
            //if (actualState == States.KnockOut)
            //    return;
            if (actualKickedFrames != 0)
                return;

            AudioMgr.Instance.PlaySoundFx(AudioMgr.AudioFx.Standing);
            
            avatarState = standingState;
            actualState = States.Standing;

            primaryAnimator.SetInteger(stateName, (int)States.Standing);
        }
예제 #2
0
        // Use this for initialization
        void Start()
        {
            primaryAnimator = primaryTransform.GetComponent<Animator>();

            _transform = GetComponent<Transform>();
            avatarState = standingState;
        }
예제 #3
0
        public void KnockOut()
        {
            AudioMgr.Instance.PlaySoundFx(AudioMgr.AudioFx.KnockOut);


            avatarState = knockOutState;
            actualState = States.KnockOut;
        }
예제 #4
0
        public void Falling()
        {
            AudioMgr.Instance.PlaySoundFx(AudioMgr.AudioFx.Falling);

            avatarState = fallingState;
            actualState = States.Falling;

            primaryAnimator.SetInteger(stateName, (int)States.Falling);
        }
예제 #5
0
        public void Kicked()
        {
            //if (actualState == States.KnockOut)
            //    return;

            avatarState = kickedState;
            actualState = States.Kicked;

            primaryAnimator.SetInteger(stateName, (int)States.KnockOut);
        }
예제 #6
0
        public void BadJump()
        {
            if (actualState == States.KnockOut)
                return;

            AudioMgr.Instance.PlaySoundFx(AudioMgr.AudioFx.BadJump);
            
            avatarState = badJumpState;
            actualState = States.BadJump;

            primaryAnimator.SetInteger(stateName, (int)States.BadJump);
        }
예제 #7
0
        public void Jump()
        {
            if (actualState == States.RunningRight
                || actualState == States.RunningLeft
                || actualState == States.Standing)
            {
                AudioMgr.Instance.PlaySoundFx(AudioMgr.AudioFx.GoodJump);
                
                avatarState = jumpingState;
                actualState = States.Jumping;

                primaryAnimator.SetInteger(stateName, (int)States.Jumping);
            }
        }
예제 #8
0
        public void RunLeft()
        {
            if (actualState == States.RunningLeft)
                return;

            if (actualState == States.RunningRight
                || actualState == States.Standing)
            {
                AudioMgr.Instance.PlaySoundFx(AudioMgr.AudioFx.Running);

                avatarState = runningLeftState;
                actualState = States.RunningLeft;

                primaryAnimator.SetInteger(stateName, (int)States.RunningLeft);
            }
        }