Beispiel #1
0
        public void Update()
        {
            if (mScaleCharacter && !mScaled && mCurrent != null && mCurrent.character != null)
            {
                DoScaleCharacter();

                mScaled = true;
            }

            if (needToTransitionToIdle || needToSetStateAfterMove != MoveController.CombatantMoveState.kIdle)
            {
                if (mCurrent != null && mCurrent.character != null)
                {
                    MoveController    moveController = mCurrent.character.GetComponent <MoveController>();
                    AnimatorStateInfo asi            = moveController.GetCurrentStateInfo();
                    if (asi.normalizedTime >= 1)
                    {
                        MoveEditor.Move theMove = moveController.GetMoveByState(needToSetStateAfterMove);
                        moveController.TransitionTo(needToSetStateAfterMove);
                        moveController.m_lobby_hash = Animator.StringToHash(string.Format("Lobby.{0}", theMove.name));
                        moveController.SetMove(theMove);
                        moveController.CrossFade(moveController.GetCurrentAnimHash(), 0.2f, 0, 0f);
                        needToTransitionToIdle  = false;
                        needToSetStateAfterMove = MoveController.CombatantMoveState.kIdle;
                    }
                }
            }
        }
Beispiel #2
0
        public new void Update()
        {
            if (mScaleCharacter && !mScaled && (mCurrent != null && mCurrent.character != null || mCurrentOther != null && mCurrentOther.character != null))
            {
                DoScaleCharacter();

                mScaled = true;
            }

            if (mCurrent != null && mCurrent.character != null)
            {
                MoveController    moveController = mCurrent.character.GetComponent <MoveController>();
                AnimatorStateInfo asi            = moveController.GetCurrentStateInfo();

                if (!((int)moveController.CurrentState == (int)MoveController.CombatantMoveState.kReady))
                {
                    if (asi.normalizedTime >= 1)
                    {
                        MoveEditor.Move theMove = moveController.GetMoveIfExists("Ready");
                        moveController.TransitionTo(MoveController.CombatantMoveState.kReady);
                        moveController.m_lobby_hash = Animator.StringToHash(string.Format("Lobby.{0}", theMove.name));
                        moveController.SetMove(theMove);
                        moveController.CrossFade(MoveController.m_ready_hash, 0.2f, 0, 0f);
                    }
                }
            }

            if (mCurrentOther != null && mCurrentOther.character != null)
            {
                MoveController    moveController = mCurrentOther.character.GetComponent <MoveController>();
                AnimatorStateInfo asi            = moveController.GetCurrentStateInfo();

                if (!((int)moveController.CurrentState == (int)MoveController.CombatantMoveState.kReady))
                {
                    if (asi.normalizedTime >= 1)
                    {
                        MoveEditor.Move theMove = moveController.GetMoveIfExists("Ready");
                        moveController.TransitionTo(MoveController.CombatantMoveState.kReady);
                        moveController.m_lobby_hash = Animator.StringToHash(string.Format("Lobby.{0}", theMove.name));
                        moveController.SetMove(theMove);
                        moveController.CrossFade(MoveController.m_ready_hash, 0.2f, 0, 0f);
                    }
                }
            }
        }
Beispiel #3
0
        public void Update()
        {
            // base.Update();

            if (needToTransitionToIdle)
            {
                if (ModelGO != null && ModelGO.GetComponent <CharacterVariant>().CharacterInstance != null)
                {
                    MoveController    moveController = ModelGO.GetComponent <CharacterVariant>().CharacterInstance.GetComponent <MoveController>();
                    AnimatorStateInfo asi            = moveController.GetCurrentStateInfo();

                    if (asi.normalizedTime >= 1)
                    {
                        MoveEditor.Move theMove = moveController.GetMoveIfExists("Idle");
                        moveController.TransitionTo(MoveController.CombatantMoveState.kIdle);
                        moveController.m_lobby_hash = Animator.StringToHash("Lobby." + theMove.name);
                        moveController.SetMove(theMove);
                        moveController.CrossFade(MoveController.m_idle_hash, 0.2f, 0, 0f);
                        needToTransitionToIdle = false;
                    }
                }
            }
        }