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; } }
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(); } } }
public void RotateOff() { rotateDirection = E_HorizontalDirection.None; }