Esempio n. 1
0
 public void AdjustSize()
 {
     if (targetWidth != currentWidth || targetHeight != currentHeight || checkedPixelZoom != pixelScale)
     {
         PixelPerfect.SetPixelPerfect(pixelsPerUnit, pixelScale);
         GetComponent <Camera>().orthographicSize = (float)((targetHeight / (PixelPerfect.pixelsPerUnit * PixelPerfect.pixelScale)) * 0.5d);
         currentWidth     = targetWidth;
         currentHeight    = targetHeight;
         checkedPixelZoom = pixelScale;
     }
 }
Esempio n. 2
0
    public void AdjustSize()
    {
        PixelPerfect.SetPixelPerfect(pixelsPerUnit, pixelZoom);
        float targetHeight;

        if (Application.isEditor)
        {
            targetHeight = PixelPerfect.GetMainGameViewSize().y;
        }
        else
        {
            targetHeight = Screen.height;
        }
        camera.orthographicSize = (float)(((double)targetHeight / (double)PixelPerfect.pixelsPerUnit / (double)PixelPerfect.pixelScale) * 0.5d);
    }