예제 #1
0
    public void RotateButtons(bool right)
    {
        if (Input.GetKey (KeyCode.LeftArrow) || Input.GetKey (KeyCode.RightArrow))
            return;

        if (!right)
        {
            rotateDirection = E_HorizontalDirection.Left;
        }
        else
        {
            rotateDirection = E_HorizontalDirection.Right;
        }
    }
예제 #2
0
파일: C_Player.cs 프로젝트: SunShuyi/FYP
    public void ChangeDirection(E_HorizontalDirection dir)
    {
        if (currDirection == dir)
        {
            return;
        }

        currDirection = dir;
        if (currDirection == E_HorizontalDirection.Right)
        {
            if(gameObject.transform.localScale.x < 0)
            {
                gameObject.transform.SetLocalScaleXNegative();
            }
        }
        else
        {
            if(gameObject.transform.localScale.x > 0)
            {
                gameObject.transform.SetLocalScaleXNegative();
            }
        }
    }
예제 #3
0
 public void RotateOff()
 {
     rotateDirection = E_HorizontalDirection.None;
 }