Ejemplo n.º 1
0
        public void RefreshGuiInfo(AssetWindow window)
        {
            var guirender = AssetTreeManager.mIns.GetGuiRender(Mode);

            if (GuiContext.WindowRect.width > 0 && GuiContext.WindowRect.height > 0 && (Mathf.Abs(GuiContext.WindowRect.width - window.position.width) > 0.1f || Mathf.Abs(GuiContext.WindowRect.height - window.position.height) > 0.1f))
            {
                if (guirender != null)
                {
                    foreach (var grender in guirender)
                    {
                        IGuiTree treeRender = grender as IGuiTree;
                        if (treeRender != null)
                        {
                            treeRender.RefreshHead();
                        }
                    }
                }
            }

            GuiContext.WindowRect  = new Rect((int)window.position.x, (int)window.position.y, (int)window.position.width, (int)window.position.height);
            GuiContext.TitleRect   = new Rect(5, 0, GuiContext.WindowRect.width - 10, EditorGuiContext.GuiHeight);
            GuiContext.ToolbarRect = new Rect(5, GuiContext.WindowRect.height - EditorGuiContext.GuiHeight, GuiContext.WindowRect.width - 10, EditorGuiContext.GuiHeight);

            if (guirender != null)
            {
                foreach (var grender in guirender)
                {
                    grender.RefreshGuiInfo(this);
                }
            }
        }
Ejemplo n.º 2
0
        public static void CreateSpriteWindow()
        {
            AssetWindow window = EditorWindow.GetWindow <AssetWindow>();

            window.titleContent = new GUIContent("AssetBundle Window");
            window.Focus();
            window.Show();

            if (EditorContexts.mIns.GuiWindow == null || !EditorContexts.mIns.GuiWindow.Inited)
            {
                EditorContexts.mIns.Mode = WindowMode.ToolsSprite;
            }
            else
            {
                EditorContexts.mIns.ForceModeChange(WindowMode.ToolsSprite);
            }
        }