void LeftRotate() { if (currentRotation != RotationStates.left) { cubeAnimator.SetTrigger("Left"); currentRotation = RotationStates.left; } }
void RightRotate() { if (currentRotation != RotationStates.right) { cubeAnimator.SetTrigger("Right"); currentRotation = RotationStates.right; } }
public static void Rotate(RotationStates state) { DisplayOrientation orientation_main = DisplayOrientation.UNKNOWN; DisplayOrientation orientation_cast = DisplayOrientation.UNKNOWN; switch (state) { case RotationStates.MODE_LAPTOP: orientation_main = orientation_cast = DisplayOrientation.LANDSCAPE; break; case RotationStates.MODE_BOOK: orientation_main = orientation_cast = DisplayOrientation.PORTRAIT; break; case RotationStates.MODE_TENT: orientation_main = DisplayOrientation.LANDSCAPE; orientation_cast = DisplayOrientation.LANDSCAPE_FLIPPED; break; case RotationStates.MODE_WEDGE: orientation_main = DisplayOrientation.LANDSCAPE_FLIPPED; orientation_cast = DisplayOrientation.LANDSCAPE; break; case RotationStates.MODE_MOBILE: orientation_main = orientation_cast = DisplayOrientation.PORTRAIT; break; case RotationStates.MODE_LAYFLAT: default: return; } if (orientation_main != DisplayOrientation.UNKNOWN && orientation_cast != DisplayOrientation.UNKNOWN) { SetOrientation(orientation_main, orientation_cast); } }