Ejemplo n.º 1
0
        protected override void OnGUI()
        {
            if (!CheckDrawHeader())
            {
                return;
            }

            Rect rectTop = GetTopPanelRect();
            Rect rectBot = GetBotPanelRect();

            RefDrawConfig config1 = null, config2 = null, config3 = null;
            var           drawTool  = false;
            var           drawCount = 0;

            if (IsFocusingUses || IsFocusingSceneToAsset)
            {
                drawTool = GetDrawConfig(SceneUsesDrawer, out config1);
            }
            else if (IsFocusingSceneInScene || IsFocusingFindInScene || IsFocusingUsedBy)
            {
                if (RefSceneInScene.ElementCount() <= 0)
                {
                    drawTool = GetDrawConfig(RefInScene, out config1);
                }
                else
                {
                    drawTool = GetDrawConfig(RefSceneInScene, out config2);
                }
            }

            if (!IsFocusingGUIDs && !IsFocusingUnused)
            {
                drawCount += DrawConfig(config1, rectTop, rectBot, ref willRepaint);
                drawCount += DrawConfig(config2, rectTop, rectBot, ref willRepaint);
                drawCount += DrawConfig(config3, rectTop, rectBot, ref willRepaint);
            }

            if (drawTool)
            {
                drawCount++;
                GUILayout.BeginArea(rectBot);
                DrawTool();
                GUILayout.EndArea();
            }

            DrawFooter();
            OnAfterGUI(drawCount);
        }
Ejemplo n.º 2
0
        // public static Rect windowRect;


        //return true if draw tool along


        protected override void OnGUI()
        {
            if (!CheckDrawHeader())
            {
                return;
            }

            //if (Selected.Count == 0){
            //  GUILayout.Label("Nothing selected");
            //}
            Rect rectTop = GetTopPanelRect();
            Rect rectBot = GetBotPanelRect();

            RefDrawConfig config1 = null, config2 = null, config3 = null;
            var           drawTool  = false;
            var           drawCount = 0;

            if (IsFocusingUses || IsFocusingSceneToAsset)
            {
                if (UsesDrawer.ElementCount() <= 0)
                {
                    drawTool = GetDrawConfig(SceneUsesDrawer, SceneToAssetDrawer, out config1, out config2);
                }
                else
                {
                    drawTool = GetDrawConfig(UsesDrawer, out config3);
                }
            }
            else if (IsFocusingSceneInScene || IsFocusingFindInScene || IsFocusingUsedBy)
            {
                if (RefSceneInScene.ElementCount() <= 0)
                {
                    drawTool = GetDrawConfig(RefInScene, UsedByDrawer, out config1, out config2);
                }
                else
                {
                    drawTool = GetDrawConfig(RefSceneInScene, out config3);
                }
            }
            else if (IsFocusingDuplicate)
            {
                drawTool = GetDrawConfig(Duplicated, out config1);
            }
            else if (IsFocusingGUIDs)
            {
                drawCount++;
                if (AnyToolInBot)
                {
                    GUILayout.BeginArea(rectTop);
                    DrawGUIDs();
                    GUILayout.EndArea();
                    drawTool = true;
                }
                else
                {
                    DrawGUIDs();
                    drawTool = false;
                }
            }
            else if (IsFocusingUnused)
            {
                drawCount++;
                if (AnyToolInBot)
                {
                    GUILayout.BeginArea(rectTop);
                    RefUnUse.Draw();
                    GUILayout.EndArea();
                    drawTool = true;
                }
                else
                {
                    RefUnUse.Draw();
                    drawTool = false;
                }
            }
            else if (IsFocusingUsedInBuild)
            {
                //Debug.Log("draw :" + IsFocusingUsedInBuild);
                //drawTool = GetDrawConfig(UsedInBuild, out config1);
                UsedInBuild.Draw();
            }

            if (!IsFocusingGUIDs && !IsFocusingUnused)
            {
                drawCount += DrawConfig(config1, rectTop, rectBot, ref willRepaint);
                drawCount += DrawConfig(config2, rectTop, rectBot, ref willRepaint);
                drawCount += DrawConfig(config3, rectTop, rectBot, ref willRepaint);
            }

            if (drawTool)
            {
                drawCount++;
                GUILayout.BeginArea(rectBot);
                DrawTool();
                GUILayout.EndArea();
            }

            DrawFooter();

            OnAfterGUI(drawCount);
        }