Exemple #1
0
 public void changeCameraOrtho(float zoomDirection)
 {
     print("zoom dir = " + zoomDirection);
     if (zoomDirection > 0)
     {
         if (orthoSize == OrthoSizes.CLOSE)
         {
             orthoSize            = OrthoSizes.MEDIUM;
             cam.orthographicSize = GetOrthoSize(OrthoSizes.MEDIUM);
         }
         else if (orthoSize == OrthoSizes.MEDIUM)
         {
             orthoSize            = OrthoSizes.LONG;
             cam.orthographicSize = GetOrthoSize(OrthoSizes.LONG);
         }
     }
     else
     {
         if (orthoSize == OrthoSizes.LONG)
         {
             orthoSize            = OrthoSizes.MEDIUM;
             cam.orthographicSize = GetOrthoSize(OrthoSizes.MEDIUM);
         }
         else if (orthoSize == OrthoSizes.MEDIUM)
         {
             orthoSize            = OrthoSizes.CLOSE;
             cam.orthographicSize = GetOrthoSize(OrthoSizes.CLOSE);
         }
     }
 }
Exemple #2
0
    public float GetOrthoSize(OrthoSizes size)
    {
        switch (size)
        {
        case OrthoSizes.CLOSE:
            return(4.21875f);

        case OrthoSizes.MEDIUM:
            return(8.4375f);

        case OrthoSizes.LONG:
            return(16.875f);
        }

        return(0);
    }