Esempio n. 1
0
    void Start()
    {
        Instance = this;

        //Resolution
        Resolution currentResolution = Screen.currentResolution;

        if (Application.isEditor)
        {
            ScreenResolution = Screen.resolutions [0];
        }
        else
        {
            ScreenResolution = currentResolution;
        }

        //Set Resolution
        Screen.SetResolution(ScreenResolution.width, ScreenResolution.height, true);

        //GUI Camera setup
        GUICamera = new GameObject("GUICamera");
        GUICamera.AddComponent <Camera>();

        Camera guiCamera = GUICamera.GetComponent <Camera>();

        guiCamera.cullingMask      = GUICameraLayerMask;
        guiCamera.name             = "GUICamera";
        guiCamera.orthographicSize = ScreenResolution.height / 2;
        guiCamera.orthographic     = true;
        guiCamera.nearClipPlane    = 0.3f;
        guiCamera.farClipPlane     = 50f;
        guiCamera.clearFlags       = CameraClearFlags.Depth;
        guiCamera.depth            = 1;
        guiCamera.rect             = new Rect(0, 0, 1, 1);
        guiCamera.renderingPath    = RenderingPath.UsePlayerSettings;
        guiCamera.targetTexture    = null;
        guiCamera.hdr = false;
    }
Esempio n. 2
0
 void Awake()
 {
     instance = this;
 }
Esempio n. 3
0
 void Awake()
 {
     instance = this;
 }