Ejemplo n.º 1
0
    IEnumerator MoveCoroutine()
    {
        m_bMove = true;
        m_controlManager.ImpenetrableOn();
        m_animFuntion.SetBool(m_animFuntion.hashBMove, true);

        while (true)
        {
            if (this.transform.localScale.x < 0)
            {
                m_characterMove.MoveLeft(m_playerInfo.fMoveSpeed);
            }
            else
            {
                m_characterMove.MoveRight(m_playerInfo.fMoveSpeed);
            }


            yield return(null);

            if (!m_bMove)
            {
                m_controlManager.ImpenetrableOff();
                m_animFuntion.SetBool(m_animFuntion.hashBMove, false);
                m_characterMove.MoveStop();
                yield break;
            }
        }
    }
Ejemplo n.º 2
0
    IEnumerator EvasionCoroutine()
    {
        m_crowdControlManager.ImpenetrableOn();
        m_animFuntion.SetTrigger(m_animFuntion.hashTEvasion);

        yield return(new WaitForSeconds(0.1f));

        if (!m_playerState.IsPlayerGround())
        {
            m_rigidbody2D.constraints = RigidbodyConstraints2D.FreezePositionY | RigidbodyConstraints2D.FreezeRotation;
            AddMeve(m_speedAir);
        }
        else
        {
            AddMeve(m_speed);
        }

        m_playerState.PlayerStateEvasion();

        while (true)
        {
            if (!m_animFuntion.IsTag("Evasion"))
            {
                break;
            }

            yield return(new WaitForSeconds(0.02f));
        }

        m_rigidbody2D.constraints = RigidbodyConstraints2D.FreezeRotation;
        m_rigidbody2D.velocity    = new Vector2(m_rigidbody2D.velocity.x / 3, 0.1f);
        m_bEvasion = false;
        m_crowdControlManager.ImpenetrableOff();

        if (m_playerState.IsPlayerGround())
        {
            m_playerState.PlayerStateReset();
        }
        else
        {
            m_playerState.PlayerStateDoubleJump();
        }
    }