예제 #1
0
        protected override void InitWindows()
        {
            knownComponents = new Dictionary <Type, List <EditorComponent> >();
            Extensions      = new List <EditorWindowExtension>();
            Menus           = new Dictionary <GenericMenu, string>();

            AddMenu(new FileMenu().menu, TC.get("MenuFile.Title"));
            AddMenu(new EditMenu().menu, TC.get("MenuEdit.Title"));
            AddMenu(new AdventureMenu().menu, TC.get("MenuAdventure.Title"));
            AddMenu(new ChaptersMenu().menu, TC.get("MenuChapters.Title"));
            AddMenu(new ConfigurationMenu().menu, TC.get("MenuConfiguration.Title"));
            AddMenu(new AboutMenu().menu, TC.get("Menu.About"));


            openedWindow = EditorWindowType.Chapter;
            var chapterWindow = new ChapterWindow(Rect.zero, new GUIContent(TC.get("Element.Name0")), "Window");

            AddExtension(new ChapterWindow(Rect.zero, new GUIContent(TC.get("Element.Name0")), "Window"));

            // Extensions of the editor
            foreach (var extension in EditorWindowBaseExtensionFactory.Instance.CreateAllExistingExtensions(Rect.zero, "Window"))
            {
                AddExtension(extension);
            }
            RequestMainView(chapterWindow);
        }
예제 #2
0
        void InitWindows()
        {
            if (chapterWindow == null)
            {
                zeroRect      = new Rect(0, 0, 0, 0);
                chapterWindow = new ChapterWindow(zeroRect, new GUIContent(TC.get("Element.Name0")), "Window");
                thisWindowReference.openedWindow = EditorWindowType.Chapter;

                // Extensions of the editor
                extensions = EditorWindowBaseExtensionFactory.Instance.CreateAllExistingExtensions(zeroRect, "Window");

                var ops = new GUILayoutOption[]
                {
                    GUILayout.ExpandWidth(true),
                    GUILayout.ExpandHeight(true)
                };
                foreach (var e in extensions)
                {
                    e.Options            = ops;
                    e.OnRequestMainView += thisWindowReference.RequestMainView;
                    e.OnRequestRepaint  += Repaint;
                    e.EndWindows         = EndWindows;
                    e.BeginWindows       = BeginWindows;
                }
            }
        }
예제 #3
0
        protected override void InitWindows()
        {
            if (Extensions == null)
            {
                AddMenu(new FileMenu().menu, TC.get("MenuFile.Title"));
                AddMenu(new EditMenu().menu, TC.get("MenuEdit.Title"));
                AddMenu(new AdventureMenu().menu, TC.get("MenuAdventure.Title"));
                AddMenu(new ChaptersMenu().menu, TC.get("MenuChapters.Title"));
                AddMenu(new ConfigurationMenu().menu, TC.get("MenuConfiguration.Title"));
                AddMenu(new AboutMenu().menu, TC.get("About.Title"));


                openedWindow = EditorWindowType.Chapter;
                var chapterWindow = new ChapterWindow(Rect.zero, new GUIContent(TC.get("Element.Name0")), "Window");
                AddExtension(new ChapterWindow(Rect.zero, new GUIContent(TC.get("Element.Name0")), "Window"));

                // Extensions of the editor
                foreach (var extension in EditorWindowBaseExtensionFactory.Instance.CreateAllExistingExtensions(Rect.zero, "Window"))
                {
                    AddExtension(extension);
                }
                RequestMainView(chapterWindow);
            }
        }