Esempio n. 1
0
        static LayoutInfo DefaultLayout(IWindowManager wm)
        {
            // デフォルトのEditorレイアウトを設定

            bool             isDialog;
            WindowDescriptor sceneWd;
            GameObject       sceneContent;

            wm.CreateWindow(RuntimeWindowType.Scene.ToString(), out sceneWd, out sceneContent, out isDialog);

            WindowDescriptor inspectorWd;
            GameObject       inspectorContent;

            wm.CreateWindow(RuntimeWindowType.Inspector.ToString(), out inspectorWd, out inspectorContent, out isDialog);

            WindowDescriptor hierarchyWd;
            GameObject       hierarchyContent;

            wm.CreateWindow(RuntimeWindowType.Hierarchy.ToString(), out hierarchyWd, out hierarchyContent, out isDialog);

            WindowDescriptor consoleWd;
            GameObject       consoleContent;

            wm.CreateWindow(RuntimeWindowType.Console.ToString(), out consoleWd, out consoleContent, out isDialog);

            LayoutInfo layout = new LayoutInfo(false,
                                               wm.CreateLayoutInfo(sceneContent.transform, "Scene", sceneWd.Icon),
                                               new LayoutInfo(true, wm.CreateLayoutInfo(hierarchyContent.transform, "Devices/Sensors", hierarchyWd.Icon), wm.CreateLayoutInfo(inspectorContent.transform, "Properties", inspectorWd.Icon), 0.5f),
                                               0.75f);

            return(layout);
        }
        private void OpenBook(LibraryItemViewModel book)
        {
            BookViewModel  bookViewModel     = new BookViewModel(book.Id);
            IWindowContext bookWindowContext = windowManager.CreateWindow(bookViewModel);

            bookWindowContext.ShowDialog();
        }
Esempio n. 3
0
        /// <summary>
        /// Creates a client window.
        /// </summary>
        public RootWindow(GraphicsDevice graphicsDevice, IWindowManager windowManager, string title, string titleGroup,
                          WindowOptions windowOptions, Vector2i position, Vector2i size, Vector2i?minSize, Vector2i?maxSize,
                          WindowState windowState, IWidget widget, uint multisampleCount, uint multisampleQuality)
        {
            // 1) Copy data.
            this.graphicsDevice = graphicsDevice;

            // 2) We create render target.
            TypelessTexture2D texture = new TypelessTexture2D(graphicsDevice, Usage.Default, TextureUsage.RenderTarget | TextureUsage.Texture,
                                                              CPUAccess.None, PixelFormat.Parse("R.UN8 G.UN8 B.UN8 A.UN8"), (uint)size.X, (uint)size.Y, 1,
                                                              multisampleCount, multisampleQuality, GraphicsLocality.DeviceOrSystemMemory, null);

            texture.DisposeOnViewDispose = true;

            Guid shareGuid = graphicsDevice.RegisterShared(texture, TextureUsage.Texture);

            RenderTargetView renderTarget = texture.CreateRenderTarget(
                PixelFormat.Parse("R.UN8 G.UN8 B.UN8 A.UN8"));

            window = windowManager.CreateWindow(shareGuid, title, titleGroup, this, windowOptions,
                                                position, size, minSize, maxSize, windowState, null, false);

            // 3) We create graphics canvas.
            GraphicsCanvas canvas = new GraphicsCanvas(graphicsDevice, renderTarget, new Vector2f(1, 1));

            // 4) We create GUI manager.
            GuiManager manager = new GuiManager(canvas);

            manager.RootObject    = widget;
            manager.PreRendering += new Action <GuiManager>(PreRenderingInternal);
            manager.Rendered     += new Action <GuiManager>(RenderedInternal);

            this.root = manager;
        }
Esempio n. 4
0
        private void Import(string assetLibrary, bool isBuiltIn)
        {
            Transform transform = m_windowManager.CreateWindow(RuntimeWindowType.ImportAssets.ToString());
            AssetLibraryImportDialog assetLibraryImporter = transform.GetComponentInChildren <AssetLibraryImportDialog>();

            assetLibraryImporter.SelectedLibrary = assetLibrary;
            assetLibraryImporter.IsBuiltIn       = isBuiltIn;
        }
        public void ShouldCreateInstancesOfFloatableWindowAdapter()
        {
            IWindowManager windowManager = this.CreateFactory();

            IWindow window = windowManager.CreateWindow();

            Assert.IsInstanceOfType(window, typeof(OOBWindowAdapter));
        }
Esempio n. 6
0
        public static LayoutInfo GetBuiltInDefaultLayout(this IWindowManager wm)
        {
            WindowDescriptor sceneWd;
            GameObject       sceneContent;
            bool             isDialog;

            wm.CreateWindow(RuntimeWindowType.Scene.ToString(), out sceneWd, out sceneContent, out isDialog);

            WindowDescriptor gameWd;
            GameObject       gameContent;

            wm.CreateWindow(RuntimeWindowType.Game.ToString(), out gameWd, out gameContent, out isDialog);

            WindowDescriptor inspectorWd;
            GameObject       inspectorContent;

            wm.CreateWindow(RuntimeWindowType.Inspector.ToString(), out inspectorWd, out inspectorContent, out isDialog);

            WindowDescriptor consoleWd;
            GameObject       consoleContent;

            wm.CreateWindow(RuntimeWindowType.Console.ToString(), out consoleWd, out consoleContent, out isDialog);

            WindowDescriptor hierarchyWd;
            GameObject       hierarchyContent;

            wm.CreateWindow(RuntimeWindowType.Hierarchy.ToString(), out hierarchyWd, out hierarchyContent, out isDialog);

            WindowDescriptor projectWd;
            GameObject       projectContent;

            wm.CreateWindow(RuntimeWindowType.Project.ToString(), out projectWd, out projectContent, out isDialog);

            WindowDescriptor animationWd;
            GameObject       animationContent;

            wm.CreateWindow(RuntimeWindowType.Animation.ToString(), out animationWd, out animationContent, out isDialog);

            LayoutInfo layout = new LayoutInfo(false,
                                               new LayoutInfo(false,
                                                              new LayoutInfo(true,
                                                                             wm.CreateLayoutInfo(inspectorContent.transform, inspectorWd.Header, inspectorWd.Icon),
                                                                             wm.CreateLayoutInfo(consoleContent.transform, consoleWd.Header, consoleWd.Icon),
                                                                             0.5f),
                                                              new LayoutInfo(true,
                                                                             wm.CreateLayoutInfo(sceneContent.transform, sceneWd.Header, sceneWd.Icon),
                                                                             new LayoutInfo(
                                                                                 wm.CreateLayoutInfo(gameContent.transform, gameWd.Header, gameWd.Icon),
                                                                                 wm.CreateLayoutInfo(animationContent.transform, animationWd.Header, animationWd.Icon)),
                                                                             0.75f),
                                                              0.25f),
                                               new LayoutInfo(true,
                                                              wm.CreateLayoutInfo(hierarchyContent.transform, hierarchyWd.Header, hierarchyWd.Icon),
                                                              wm.CreateLayoutInfo(projectContent.transform, projectWd.Header, projectWd.Icon),
                                                              0.5f),
                                               0.75f);

            return(layout);
        }
        static LayoutInfo DefaultLayout(IWindowManager wm)
        {
            bool isDialog;

            WindowDescriptor sceneWd;
            GameObject       sceneContent;

            wm.CreateWindow(RuntimeWindowType.Scene.ToString(), out sceneWd, out sceneContent, out isDialog);

            WindowDescriptor gameWd;
            GameObject       gameContent;

            wm.CreateWindow(RuntimeWindowType.Game.ToString(), out gameWd, out gameContent, out isDialog);

            WindowDescriptor inspectorWd;
            GameObject       inspectorContent;

            wm.CreateWindow(RuntimeWindowType.Inspector.ToString(), out inspectorWd, out inspectorContent, out isDialog);

            WindowDescriptor hierarchyWd;
            GameObject       hierarchyContent;

            wm.CreateWindow(RuntimeWindowType.Hierarchy.ToString(), out hierarchyWd, out hierarchyContent, out isDialog);

            LayoutInfo layout = new LayoutInfo(false,
                                               new LayoutInfo(
                                                   new LayoutInfo(sceneContent.transform, sceneWd.Header, sceneWd.Icon),
                                                   new LayoutInfo(gameContent.transform, gameWd.Header, gameWd.Icon)),
                                               new LayoutInfo(true,
                                                              new LayoutInfo(inspectorContent.transform, inspectorWd.Header, inspectorWd.Icon),
                                                              new LayoutInfo(hierarchyContent.transform, hierarchyWd.Header, hierarchyWd.Icon),
                                                              0.5f),
                                               0.75f);

            return(layout);
        }
Esempio n. 8
0
        public static void OpenTerrainEditor()
        {
            IWindowManager wm = IOC.Resolve <IWindowManager>();

            wm.CreateWindow("TerrainEditor");
        }
Esempio n. 9
0
 private void OnEditMaterials()
 {
     m_wm.CreateWindow("MaterialPalette", false, UIControls.DockPanels.RegionSplitType.Left, 0.2f);
 }
Esempio n. 10
0
        public static void Open()
        {
            IWindowManager wm = IOC.Resolve <IWindowManager>();

            wm.CreateWindow("NavigationView");
        }
        public static void OpenProBuilder()
        {
            IWindowManager wm = IOC.Resolve <IWindowManager>();

            wm.CreateWindow("ProBuilder");
        }
Esempio n. 12
0
 public virtual void CreateWindow(string windowTypeName)
 {
     m_wm.CreateWindow(windowTypeName);
 }
        public static void OpenMeshDeformer()
        {
            IWindowManager wm = IOC.Resolve <IWindowManager>();

            wm.CreateWindow("MeshDeformer");
        }
Esempio n. 14
0
        private LayoutInfo DefaultLayout(IWindowManager wm)
        {
            bool isDialog;

            WindowDescriptor sceneWd;
            GameObject       sceneContent;

            wm.CreateWindow(RuntimeWindowType.Scene.ToString(), out sceneWd, out sceneContent, out isDialog);

            WindowDescriptor sceneXWd;
            GameObject       sceneXContent;
            RuntimeWindow    xWindow = wm.CreateWindow(RuntimeWindowType.Scene.ToString(), out sceneXWd, out sceneXContent, out isDialog).GetComponent <RuntimeWindow>();

            // xWindow.CanActivate = false;

            RunNextFrame(() =>
            {
                IScenePivot xPivot    = xWindow.IOCContainer.Resolve <IScenePivot>();
                xPivot.Pivot.position = new Vector3(5, 0, 0);

                xWindow.Camera.transform.position = Vector3.right * 20;
                xWindow.Camera.transform.LookAt(xPivot.Pivot);
                xWindow.Camera.orthographic = true;

                PositionHandle positionHandle = wm.GetComponents(xWindow.transform).SelectMany(c => c.GetComponentsInChildren <PositionHandle>(true)).FirstOrDefault();
                positionHandle.GridSize       = 2;

                RotationHandle rotationHandle = wm.GetComponents(xWindow.transform).SelectMany(c => c.GetComponentsInChildren <RotationHandle>(true)).FirstOrDefault();
                rotationHandle.GridSize       = 5;

                Tab tab = Region.FindTab(xWindow.transform);
                tab.IsCloseButtonVisible = false;
            });

            WindowDescriptor gameWd;
            GameObject       gameContent;

            wm.CreateWindow(RuntimeWindowType.Game.ToString(), out gameWd, out gameContent, out isDialog);

            WindowDescriptor inspectorWd;
            GameObject       inspectorContent;

            wm.CreateWindow(RuntimeWindowType.Inspector.ToString(), out inspectorWd, out inspectorContent, out isDialog);

            WindowDescriptor hierarchyWd;
            GameObject       hierarchyContent;

            wm.CreateWindow(RuntimeWindowType.Hierarchy.ToString(), out hierarchyWd, out hierarchyContent, out isDialog);

            LayoutInfo layout = new LayoutInfo(false,
                                               new LayoutInfo(true,
                                                              new LayoutInfo(
                                                                  new LayoutInfo(sceneContent.transform, sceneWd.Header, sceneWd.Icon),
                                                                  new LayoutInfo(gameContent.transform, gameWd.Header, gameWd.Icon)),
                                                              new LayoutInfo(sceneXContent.transform, sceneXWd.Header, sceneXWd.Icon),
                                                              0.5f),
                                               new LayoutInfo(true,
                                                              new LayoutInfo(inspectorContent.transform, inspectorWd.Header, inspectorWd.Icon),
                                                              new LayoutInfo(hierarchyContent.transform, hierarchyWd.Header, hierarchyWd.Icon),
                                                              0.5f),
                                               0.75f);

            return(layout);
        }