Beispiel #1
0
 protected void SetNeedToTransitionToIdle(GameObject character, bool needToTransitionToIdle)
 {
     if (character != null)
     {
         PlayerEquipmentDataLookup lookup = character.GetDataLookupILRComponent <PlayerEquipmentDataLookup>("Hotfix_LT.UI.PlayerEquipmentDataLookup", false);
         if (lookup == null)
         {
             MoveController mc = character.GetComponent <MoveController>();
             if (mc != null && mc.GetMoveByState(MoveController.CombatantMoveState.kLobby) != null)
             {
                 System.Action fn = () =>
                 {
                     lookup = character.AddDataLookupILRComponent <PlayerEquipmentDataLookup>("Hotfix_LT.UI.PlayerEquipmentDataLookup");
                     lookup.needToTransitionToIdle = needToTransitionToIdle;
                 };
                 if (!mc.IsInitialized)
                 {
                     mc.RegisterInitSuccCallBack(fn);
                 }
                 else
                 {
                     fn();
                 }
             }
         }
         else
         {
             lookup.needToTransitionToIdle = needToTransitionToIdle;
         }
     }
 }
Beispiel #2
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;
                    }
                }
            }
        }