Inheritance: UnityEngine.MonoBehaviour
Example #1
0
 static public int get_constantSize(IntPtr l)
 {
     try {
         FairyGUI.StageCamera self = (FairyGUI.StageCamera)checkSelf(l);
         pushValue(l, true);
         pushValue(l, self.constantSize);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Example #2
0
 static public int ApplyModifiedProperties(IntPtr l)
 {
     try {
         FairyGUI.StageCamera self = (FairyGUI.StageCamera)checkSelf(l);
         self.ApplyModifiedProperties();
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Example #3
0
 static public int set_cachedCamera(IntPtr l)
 {
     try {
         FairyGUI.StageCamera self = (FairyGUI.StageCamera)checkSelf(l);
         UnityEngine.Camera   v;
         checkType(l, 2, out v);
         self.cachedCamera = v;
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Example #4
0
 static public int set_constantSize(IntPtr l)
 {
     try {
         FairyGUI.StageCamera self = (FairyGUI.StageCamera)checkSelf(l);
         System.Boolean       v;
         checkType(l, 2, out v);
         self.constantSize = v;
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Example #5
0
 void OnLevelWasLoaded()
 {
     StageCamera.CheckMainCamera();
 }
Example #6
0
 void SceneManager_sceneLoaded(Scene scene, LoadSceneMode mode)
 {
     StageCamera.CheckMainCamera();
 }
Example #7
0
        void HandleScreenSizeChanged()
        {
            if (!Application.isPlaying)
            {
                DisplayObject.hideFlags = HideFlags.DontSaveInEditor;
            }

            screenSizeVer = StageCamera.screenSizeVer;

            int width  = Screen.width;
            int height = Screen.height;

            if (this.container != null)
            {
                Camera cam = container.GetRenderCamera();
                if (cam.targetDisplay != 0 && cam.targetDisplay < Display.displays.Length)
                {
                    width  = Display.displays[cam.targetDisplay].renderingWidth;
                    height = Display.displays[cam.targetDisplay].renderingHeight;
                }

                if (this.container.renderMode != RenderMode.WorldSpace)
                {
                    StageCamera sc = cam.GetComponent <StageCamera>();
                    if (sc == null)
                    {
                        sc = StageCamera.main.GetComponent <StageCamera>();
                    }
                    this.container.scale = new Vector2(sc.unitsPerPixel * UIContentScaler.scaleFactor, sc.unitsPerPixel * UIContentScaler.scaleFactor);
                }
            }

            width  = Mathf.CeilToInt(width / UIContentScaler.scaleFactor);
            height = Mathf.CeilToInt(height / UIContentScaler.scaleFactor);
            if (_ui != null)
            {
                switch (fitScreen)
                {
                case FitScreen.FitSize:
                    _ui.SetSize(width, height);
                    _ui.SetXY(0, 0, true);
                    break;

                case FitScreen.FitWidthAndSetMiddle:
                    _ui.SetSize(width, _ui.sourceHeight);
                    _ui.SetXY(0, (int)((height - _ui.sourceHeight) / 2), true);
                    break;

                case FitScreen.FitHeightAndSetCenter:
                    _ui.SetSize(_ui.sourceWidth, height);
                    _ui.SetXY((int)((width - _ui.sourceWidth) / 2), 0, true);
                    break;
                }

                UpdateHitArea();
            }
            else
            {
                switch (fitScreen)
                {
                case FitScreen.FitSize:
                    uiBounds.position = new Vector2(0, 0);
                    uiBounds.size     = new Vector2(width, height);
                    break;

                case FitScreen.FitWidthAndSetMiddle:
                    uiBounds.position = new Vector2(0, (int)((height - cachedUISize.y) / 2));
                    uiBounds.size     = new Vector2(width, cachedUISize.y);
                    break;

                case FitScreen.FitHeightAndSetCenter:
                    uiBounds.position = new Vector2((int)((width - cachedUISize.x) / 2), 0);
                    uiBounds.size     = new Vector2(cachedUISize.x, height);
                    break;
                }
            }
        }
Example #8
0
 void SceneManager_sceneLoaded(UnityEngine.SceneManagement.Scene scene, LoadSceneMode mode)
 {
     StageCamera.CheckMainCamera();
 }