コード例 #1
0
ファイル: BlockoutEditorWindow.cs プロジェクト: dealien/Hunte
        void Update()
        {
            sections.ToList().ForEach(x => x.Update());

            if (currentScene != SceneManager.GetActiveScene() && !renderingSplash)
            {
                BlockoutEditorSettings.CurrentSceneSetting = null;
                currentScene = SceneManager.GetActiveScene();
                BlockoutStaticFunctions.TryLoadSceneDefinitions();
                BlockoutStaticFunctions.FindHeirachy(ref hierarchy);
            }
        }
コード例 #2
0
        public override void DrawSection()
        {
            repaint = false;

            using (new HorizontalCenteredScope())
            {
                GUILayout.Box(EUIResourceManager.Instance.GetContent("Blockout Logo"), EUIResourceManager.Instance.Skin.GetStyle("Texture"), GUILayout.Width(BlockoutEditorSettings.OneColumnWidth), GUILayout.Height(120));
            }

            if (GUILayout.Button(EUIResourceManager.Instance.GetContent("Create Hierarchy"), GUILayout.Height(EditorGUIUtility.singleLineHeight * 6), GUILayout.Width(BlockoutEditorSettings.OneColumnWidth)))
            {
                if (!BlockoutStaticFunctions.FindHeirachy(ref blockoutHierarchy))
                {
                    if (EditorSceneManager.SaveOpenScenes())
                    {
                        using (new UndoScope("Create Blockout Hierarchy"))
                        {
                            blockoutHierarchy.root = new GameObject("Blockout").transform;
                            Undo.RegisterCreatedObjectUndo(blockoutHierarchy.root.gameObject, "");
                            blockoutHierarchy.root.gameObject.AddComponent <BlockoutCommentInGameGUI>();
                            blockoutHierarchy.root.gameObject.AddComponent <Notepad>();
                            var section = blockoutHierarchy.root.gameObject.AddComponent <BlockoutSection>();
                            section.Section = SectionID.Root;
                            BlockoutStaticFunctions.CreateBlockoutSubHeirachyWithRoot(blockoutHierarchy.root);
                            BlockoutStaticFunctions.FindHeirachy(ref blockoutHierarchy);
                            BlockoutStaticFunctions.TryLoadSceneDefinitions();
                        }
                    }
                    else
                    {
                        EditorUtility.DisplayDialog("Blockout Editor Error", "You need to have a SAVED scene before using the Blockout system", "OK");
                    }
                }
            }

            GUILayout.Space(5);
            GUILayout.Label(EUIResourceManager.Instance.GetContent("Intro Label"));
            GUILayout.Space(5);

            if (newVersion != BlockoutEditorSettings.VERSION)
            {
                GUILayout.Space(5);
                using (new HorizontalCenteredScope())
                {
                    GUILayout.Label("New Version Available (" + newVersion + ")", EditorStyles.boldLabel,
                                    GUILayout.Height(EditorGUIUtility.singleLineHeight * 2));
                }

                GUILayout.Space(5);
            }

            GUILayout.Label(EUIResourceManager.Instance.GetContent("Example Scenes"), GUILayout.Width(390), GUILayout.Height(EditorGUIUtility.singleLineHeight * 2));
            if (GUILayout.Button(EUIResourceManager.Instance.GetContent("All Assets"), GUILayout.Width(390),
                                 GUILayout.Height(EditorGUIUtility.singleLineHeight * 3 + 8)))
            {
                EditorSceneManager.OpenScene("Assets/Blockout/Examples/All Assets.unity");
            }

            using (new HorizontalCenteredScope())
            {
                if (GUILayout.Button(EUIResourceManager.Instance.GetContent("FPS Scene"), GUILayout.Width(193), GUILayout.Height(125)))
                {
                    EditorSceneManager.OpenScene("Assets/Blockout/Examples/FPS.unity");
                }
                if (GUILayout.Button(EUIResourceManager.Instance.GetContent("Rollerball Scene"), GUILayout.Width(193), GUILayout.Height(125)))
                {
                    EditorSceneManager.OpenScene("Assets/Blockout/Examples/Rollerball.unity");
                }
            }

            GUILayout.Space(5);

            GUILayout.Label("Keyboard Shortcuts");

            using (new GUILayout.HorizontalScope())
            {
                if (Application.platform == RuntimePlatform.WindowsEditor)
                {
                    GUILayout.Label("Ctrl + ALT + B", EditorStyles.boldLabel, GUILayout.Width(152));
                    GUILayout.Label("Show The Blockout Window");
                }
                else
                {
                    GUILayout.Label("Cmd + ALT + B", EditorStyles.boldLabel, GUILayout.Width(152));
                    GUILayout.Label("Show / Hide The Blockout Window");
                }
            }

            using (new GUILayout.HorizontalScope())
            {
                GUILayout.Label("Alt + S", EditorStyles.boldLabel, GUILayout.Width(152));
                GUILayout.Label("Toggle Auto Grid Snapping");
            }

            using (new GUILayout.HorizontalScope())
            {
                GUILayout.Label("Alt + C", EditorStyles.boldLabel, GUILayout.Width(152));
                GUILayout.Label("Toggle Comments");
            }

            using (new GUILayout.HorizontalScope())
            {
                GUILayout.Label("Alt + Z", EditorStyles.boldLabel, GUILayout.Width(152));
                GUILayout.Label("Decrease Grid Snapping Value");
            }

            using (new GUILayout.HorizontalScope())
            {
                GUILayout.Label("Alt + X", EditorStyles.boldLabel, GUILayout.Width(152));
                GUILayout.Label("Increase Grid Snapping Value");
            }

            using (new GUILayout.HorizontalScope())
            {
                GUILayout.Label("End", EditorStyles.boldLabel, GUILayout.Width(152));
                GUILayout.Label("Snap to ground (-Y)");
            }

            using (new GUILayout.HorizontalScope())
            {
                GUILayout.Label("L", EditorStyles.boldLabel, GUILayout.Width(152));
                GUILayout.Label("Toggle Locked Assets");
            }

            using (new GUILayout.HorizontalScope())
            {
                GUILayout.Label("G", EditorStyles.boldLabel, GUILayout.Width(152));
                GUILayout.Label("Jump To Selected Prefab In Project");
            }

            using (new GUILayout.HorizontalScope())
            {
                GUILayout.Label("C (Hold)", EditorStyles.boldLabel, GUILayout.Width(152));
                GUILayout.Label("(Hold) Show Scroll Picker");
            }

            using (new GUILayout.HorizontalScope())
            {
                GUILayout.Label("", EditorStyles.boldLabel, GUILayout.Width(152));
                GUILayout.Label("(Release) Confirm Swap");
            }

            using (new GUILayout.HorizontalScope())
            {
                GUILayout.Label("Space", EditorStyles.boldLabel, GUILayout.Width(152));
                GUILayout.Label("Scrollpicker: Spawn Selected Asset");
            }

            using (new GUILayout.HorizontalScope())
            {
                GUILayout.Label("", EditorStyles.boldLabel, GUILayout.Width(152));
                GUILayout.Label("Quickpicker: Show / Select Item");
            }
            using (new GUILayout.HorizontalScope())
            {
                GUILayout.Label("Arrow Keys", EditorStyles.boldLabel, GUILayout.Width(152));
                GUILayout.Label("Quickpicker: Change selection");
            }

            GUILayout.Space(5);


            using (new GUILayout.HorizontalScope())
            {
                if (GUILayout.Button(EUIResourceManager.Instance.GetContent("Open Documentation"), GUILayout.Width(193),
                                     GUILayout.Height(EditorGUIUtility.singleLineHeight * 3 + 8)))
                {
                    BlockoutStaticFunctions.OpenDocumentation();
                }
                if (GUILayout.Button(EUIResourceManager.Instance.GetContent("Open Tutorials"), GUILayout.Width(193),
                                     GUILayout.Height(EditorGUIUtility.singleLineHeight * 3 + 8)))
                {
                    BlockoutStaticFunctions.OpenTutorials();
                }
            }

            GUILayout.Space(5);

            if (GUILayout.Button(EUIResourceManager.Instance.GetContent("Feedback"), GUILayout.Width(390), GUILayout.Height(EditorGUIUtility.singleLineHeight * 3 + 8)))
            {
                BlockoutStaticFunctions.SubmitBugReport();
            }

            GUILayout.Space(10);

            using (new HorizontalCenteredScope())
            {
                GUILayout.Box(EUIResourceManager.Instance.GetContent("Radical Forge Logo"), EUIResourceManager.Instance.Skin.GetStyle("Texture"), GUILayout.Width(150),
                              GUILayout.Height(45));
            }
        }