Exemplo n.º 1
0
 public override void OnDo()
 {
     base.OnDo();
     if (CurAnimatorStateInfo.IsName(LGAnimatorStateNameEnum.IdleState.ToString()))
     {
         CurLGFsm.CurLGCtrl.LGAnimator.SetInteger(LGAnimatorConditionEnum.CurState.ToString(), (int)LGStateEnum.LGIdle);
     }
 }
Exemplo n.º 2
0
    public override void OnDo()
    {
        base.OnDo();

        if (!m_AttackCding)
        {
            if (Input.GetKeyDown(KeyCode.X))
            {
                m_AttackCding    = true;
                m_LastAttackTime = Time.time;
                m_ComboIndex++;

                if (m_ComboIndex > 2)
                {
                    m_ComboIndex = 0;
                }

                CurLGFsm.CurLGCtrl.LGAnimator.SetInteger(LGAnimatorConditionEnum.ComboIndex.ToString(), m_ComboIndex);
            }
        }
        else
        {
            m_AttackCdTimer = m_AttackCdTimer + Time.deltaTime;
            if (m_AttackCdTimer >= m_AttackCd)
            {
                m_AttackCdTimer = 0;
                m_AttackCding   = false;
            }
        }

        //俩次攻击间隔超过m_MaxAttackInterval,则回到待机状态
        if (Time.time - m_LastAttackTime >= m_MaxAttackInterval)
        {
            CurLGFsm.ChangeState(StateEnum.Idle);
        }

        if (CurAnimatorStateInfo.IsName(LGAnimatorStateNameEnum.AttackState1.ToString()))
        {
            CurLGFsm.CurLGCtrl.LGAnimator.SetInteger(LGAnimatorConditionEnum.CurState.ToString(), (int)LGStateEnum.LGAttack1);
        }

        if (CurAnimatorStateInfo.IsName(LGAnimatorStateNameEnum.AttackState2.ToString()))
        {
            CurLGFsm.CurLGCtrl.LGAnimator.SetInteger(LGAnimatorConditionEnum.CurState.ToString(), (int)LGStateEnum.LGAttack2);
        }

        if (CurAnimatorStateInfo.IsName(LGAnimatorStateNameEnum.AttackState3.ToString()))
        {
            CurLGFsm.CurLGCtrl.LGAnimator.SetInteger(LGAnimatorConditionEnum.CurState.ToString(), (int)LGStateEnum.LGAttack3);
        }
    }
Exemplo n.º 3
0
    public override void OnDo()
    {
        base.OnDo();
        if (CurAnimatorStateInfo.IsName(LGAnimatorStateNameEnum.JumpState.ToString()))
        {
            CurLGFsm.CurLGCtrl.LGAnimator.SetInteger(LGAnimatorConditionEnum.CurState.ToString(), (int)LGStateEnum.LGJump);

            //Debug.Log("CurAnimatorStateInfo.normalizedTime" + CurAnimatorStateInfo.normalizedTime);
            if (CurAnimatorStateInfo.normalizedTime > 1)
            {
                CurLGFsm.GoBackLastState();
            }
        }

        if (m_IsInSky)
        {
            DisposeMove();
        }
    }