private static void OnScene(SceneView sceneview)
        {
            if (!texturePlaceholder)
            {
                texturePlaceholder = new Texture2D(1, 1);
            }
            if (!hasLoadedWebpage)
            {
                WebClient client = new WebClient();
                client.DownloadStringCompleted += NewVersion;
                client.DownloadStringAsync(new Uri("http://pastebin.com/raw/SeGjnLg5"));
                hasLoadedWebpage = true;
            }


#if SKS_VR
            SKSGlobalRenderSettings.SinglePassStereo = PlayerSettings.stereoRenderingPath == StereoRenderingPath.SinglePass;
#endif

            /*
             * //Visualize portal connections, and easily find portals that are not connected to anything
             * if (SKSGlobalRenderSettings.PortalVisualization)
             * {
             *  foreach (PortalController p in SKSGlobalRenderSettings.PortalControllers)
             *  {
             *      if (!p) continue;
             *      p.OnDrawGizmos();
             *      p.OnDrawGizmosSelected();
             *  }
             * }*/



            if (material == null)
            {
                material = Resources.Load <Material>("UI/blur");
            }

            if (Camera.current.name.Equals("SceneCamera"))
            {
                sceneCamera = Camera.current;
                UIBlurController.AddBlurToCamera(sceneCamera);
            }


            if (skin.button != null)
            {
                menuOptionsStyle = new GUIStyle(skin.button);
            }
            else
            {
                menuOptionsStyle = new GUIStyle();
            }

            if (EditorStyles.foldout != null)
            {
                coloredFoldout = new GUIStyle(EditorStyles.foldout);
            }
            else
            {
                coloredFoldout = new GUIStyle();
            }
            coloredFoldout.normal.textColor    = Color.white;
            coloredFoldout.hover.textColor     = Color.white;
            coloredFoldout.active.textColor    = Color.white;
            coloredFoldout.focused.textColor   = Color.white;
            coloredFoldout.active.textColor    = Color.white;
            coloredFoldout.onActive.textColor  = Color.white;
            coloredFoldout.onFocused.textColor = Color.white;
            coloredFoldout.onHover.textColor   = Color.white;
            coloredFoldout.onNormal.textColor  = Color.white;


            menuOptionsStyle.fontSize  = 10;
            menuOptionsStyle.fontStyle = FontStyle.Bold;
            menuOptionsStyle.wordWrap  = false;
            menuOptionsStyle.clipping  = TextClipping.Overflow;
            Handles.BeginGUI();



            GUI.skin = skin;
            //windowRect = new Rect (Screen.width - size.x - 100, Screen.height - size.y - 190, 200, 200);
            if (SetupUtility.projectInitialized)
            {
                if (SKSGlobalRenderSettings.MenuClosed)
                {
                    Handles.EndGUI();
                    return;
                }
                Graphics.DrawTexture(new Rect(windowRect.x, windowRect.y - 16, windowRect.width, windowRect.height),
                                     texturePlaceholder, material);
                GUI.Window(0, windowRect, DoMyWindow, "Global Portal Settings");
                GUI.skin = null;
                Handles.EndGUI();
            }
            else
            {
                Graphics.DrawTexture(new Rect(0, 0, Screen.width, Screen.height), texturePlaceholder, material);
                if (GUILayout.Button("Click here to re-open the import dialog"))
                {
                    SettingsWindow.Show();
                }
            }
        }
Beispiel #2
0
        private static void OnScene(SceneView sceneview)
        {
            Styles.Init();
            if (!texturePlaceholder)
            {
                texturePlaceholder = new Texture2D(1, 1);
            }
            if (!hasLoadedWebpage)
            {
                _notificationInfo = new NotificationInfo();
                new Thread(GetNotifications).Start();
                hasLoadedWebpage = true;
            }

#if SKS_VR
            SKSGlobalRenderSettings.SinglePassStereo = PlayerSettings.stereoRenderingPath == StereoRenderingPath.SinglePass;
#endif

            if (Camera.current.name.Equals("SceneCamera"))
            {
                sceneCamera = Camera.current;
                UIBlurController.AddBlurToCamera(sceneCamera);
            }



            Handles.BeginGUI();



            GUI.skin = skin;
            //windowRect = new Rect (Screen.width - size.x - 100, Screen.height - size.y - 190, 200, 200);
            if (SetupUtility.projectInitialized)
            {
                if (SKSGlobalRenderSettings.MenuClosed)
                {
                    Handles.EndGUI(); return;
                }
                //Blur
                Graphics.DrawTexture(new Rect(windowRect.x, windowRect.y - 16, windowRect.width, windowRect.height),
                                     texturePlaceholder, Styles.blurMat);
                //Window Border
                //Graphics.DrawTexture(new Rect(windowRect.x, windowRect.y - 16, windowRect.width, windowRect.height),
                //    Styles.borderTex, Styles.borderMat);
                GUI.Window(0, windowRect, DoWindow, "<color=#2599f5>[PKPRO]</color> Notifications:");

                GUI.skin = null;
                Handles.EndGUI();
            }
            else
            {
                Graphics.DrawTexture(new Rect(0, 0, Screen.width, Screen.height), texturePlaceholder, Styles.blurMat);
                if (GUILayout.Button("Click here to re-open the import dialog"))
                {
                    SettingsWindow.Show();
                }
#if SKS_DEV
                if (GUILayout.Button(
                        "(Intended for the devs of the asset) Click here to reset the ScriptableObjects for deployment"))
                {
                    SKSGlobalRenderSettings.RecursionNumber = 0;
                    SKSGlobalRenderSettings.AggressiveRecursionOptimization = true;
                    SKSGlobalRenderSettings.AdaptiveQuality      = true;
                    SKSGlobalRenderSettings.CustomSkybox         = true;
                    SKSGlobalRenderSettings.Preview              = false;
                    SKSGlobalRenderSettings.PhysicsPassthrough   = false;
                    SKSGlobalRenderSettings.PhysStyleB           = true;
                    SKSGlobalRenderSettings.Gizmos               = true;
                    SKSGlobalRenderSettings.IgnoredNotifications = new List <int>();
                    SKSGlobalRenderSettings.MenuClosed           = false;
                    SKSGlobalRenderSettings.Minimized            = false;
                    GlobalPortalSettings.Nagged = false;
                }
#endif
            }
        }