コード例 #1
0
    //--------------------------------------------------------------------------------
    // 角色连击协程
    //--------------------------------------------------------------------------------
    private void SkillDoubleHitsAttack()
    {
        if (!IsInActCD())
        {
            m_LocalFSM.ChangeBeHavior(BehaviorType.EState_Skill, m_dwCurSkillID);

            // 播放攻击动作
            SetActCD(true);
        }
    }
コード例 #2
0
ファイル: CtrolPlayerMove.cs プロジェクト: liuxx220/GameApp
    void UpdateNoCombatJoystick(float touchX, float touchY)
    {
        if (m_LocalFSM == null)
        {
            return;
        }

        if (m_LocalFSM.IsInIdle() && (Math.Abs(touchX) + Math.Abs(touchY)) > 0f)
        {
            m_LocalFSM.ChangeBeHavior(BehaviorType.EState_Move, 0);
        }

        if (m_LocalFSM.IsInMoveing() && (Math.Abs(touchX) + Math.Abs(touchY)) < 0.001f)
        {
            m_LocalFSM.ChangeBeHavior(BehaviorType.EState_Idle, 0);
        }


        m_velocity = Vector3.zero;
        if (m_character.isGrounded)
        {
            if (touchX > 0)
            {
                m_velocity = Vector3.forward * m_fmovespeed * 0.02f;
            }

            if (touchX < 0)
            {
                m_velocity = Vector3.forward * -m_fmovespeed * 0.02f;
            }

            if (touchY > 0)
            {
                transform.Rotate(0, 120 * Time.deltaTime, 0);
            }

            if (touchY < 0)
            {
                transform.Rotate(0, -120 * Time.deltaTime, 0);
            }
        }

        m_velocity    = transform.TransformDirection(m_velocity);
        m_velocity.y -= m_Gravity * Time.deltaTime;
        m_character.Move(m_velocity);
    }