Ejemplo n.º 1
0
 void LeftRotate()
 {
     if (currentRotation != RotationStates.left)
     {
         cubeAnimator.SetTrigger("Left");
         currentRotation = RotationStates.left;
     }
 }
Ejemplo n.º 2
0
 void RightRotate()
 {
     if (currentRotation != RotationStates.right)
     {
         cubeAnimator.SetTrigger("Right");
         currentRotation = RotationStates.right;
     }
 }
Ejemplo n.º 3
0
        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);
            }
        }