Пример #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;
            }
        }
    }
Пример #2
0
 private void AddMeve(float _speed)
 {
     if (Input.GetAxisRaw("Horizontal") < 0 || m_playerInput.joystickState == PlayerInput.JOYSTICK_STATE.JOYSTICK_LEFT)
     {
         m_characterMove.MoveLeft(_speed);
     }
     else if (Input.GetAxisRaw("Horizontal") > 0 || m_playerInput.joystickState == PlayerInput.JOYSTICK_STATE.JOYSTICK_RIGHT)
     {
         m_characterMove.MoveRight(_speed);
     }
 }
Пример #3
0
 public void Move(float _speed)
 {
     if (m_playerTransform.position.x - m_monsterTransform.position.x > 0)
     {
         m_characterMove.MoveRight(_speed);
     }
     else
     {
         m_characterMove.MoveLeft(_speed);
     }
 }
Пример #4
0
 private void Move()
 {
     if (Input.GetAxisRaw("Horizontal") < 0)
     {
         m_animFuntion.SetBool(m_animFuntion.hashBMove, true);
         m_characterMove.MoveLeft(m_playerInfo.fMoveSpeed);
         m_underUI.transform.localScale = new Vector3(-1, 1, 1);
     }
     else if (Input.GetAxisRaw("Horizontal") > 0)
     {
         m_animFuntion.SetBool(m_animFuntion.hashBMove, true);
         m_characterMove.MoveRight(m_playerInfo.fMoveSpeed);
         m_underUI.transform.localScale = new Vector3(1, 1, 1);
     }
     else if (m_animFuntion.GetBool(m_animFuntion.hashBMove))
     {
         m_animFuntion.SetBool(m_animFuntion.hashBMove, false);
         m_characterMove.MoveStop();
     }
 }
Пример #5
0
    private void ButtonOnClick(EInputState inputValue)
    {
        switch (inputValue)
        {
        case EInputState.Left:
            _playerMoves.MoveLeft();
            break;

        case EInputState.Right:
            _playerMoves.MoveRight();
            break;

        case EInputState.Down:
            _playerMoves.ThrowBox();
            break;
        }
    }