public override Rect OnGUI()
        {
            GUILayout.BeginHorizontal(EditorStyles.toolbar);
            {
                // toggle interface type objects
                EditorGUI.BeginChangeCheck();
                {
                    includeInterfaces = GUILayout.Toggle(includeInterfaces, "Include Interfaces", EditorStyles.toolbarButton);
                }
                if (EditorGUI.EndChangeCheck())
                {
                    api.Rebuild();
                }

                GUILayout.FlexibleSpace();
                if (!api.GetTargets().Any() && GUILayout.Button("inspect Unity Object"))
                {
                    api.ResetTargets(new[] { typeof(UnityEngine.Object) });
                }

                // search field
                GUILayout.FlexibleSpace();
                searchstring = BackendUtil.DrawEntitySelectSearchField(searchstring, api);
            }
            GUILayout.EndHorizontal();
            return(BackendUtil.GetMaxRect());
        }
 public override Rect OnGUI()
 {
     GUILayout.BeginHorizontal(EditorStyles.toolbar);
     {
         GUILayout.FlexibleSpace();
         searchString = BackendUtil.DrawEntitySelectSearchField(searchString, api);
     }
     GUILayout.EndHorizontal();
     return(BackendUtil.GetMaxRect());
 }
Esempio n. 3
0
        // no need for toolbar or controls
        public Rect OnGUI()
        {
            GUILayout.BeginHorizontal(EditorStyles.toolbar);
            {
                if (GUILayout.Button("Show active scene", EditorStyles.toolbarButton, GUILayout.ExpandWidth(false)))
                {
                    api.ResetTargets(new object[] { sceneObj });
                }

                EditorGUI.BeginChangeCheck();
                includeComponents = GUILayout.Toggle(includeComponents, "Include components");
                if (EditorGUI.EndChangeCheck())
                {
                    api.Rebuild();
                }

                GUILayout.FlexibleSpace();
            }
            GUILayout.EndHorizontal();
            return(BackendUtil.GetMaxRect());
        }
        public override Rect OnGUI()
        {
            GUILayout.BeginHorizontal(EditorStyles.toolbar);
            {
                GUILayout.FlexibleSpace();

                showLegend = GUILayout.Toggle(showLegend, "Legend", EditorStyles.toolbarButton, GUILayout.ExpandWidth(false));
                if (showLegend)
                {
                    string title       = "Node colors";
                    var    colorLegend = new ColorLegendEntry[]
                    {
                        new ColorLegendEntry()
                        {
                            text = "Target Object", color = api.GetSkin().entityWidget.targetBackgroundColor
                        },
                        new ColorLegendEntry()
                        {
                            text = "Asset", color = api.GetSkin().entityWidget.backgroundColor
                        },
                        new ColorLegendEntry()
                        {
                            text = "Scene Object", color = sceneNodeColor
                        }
                    };

                    var   boxSize = ColorLegendBox.GetSize(title, colorLegend);
                    float boxPosX = EditorGUIUtility.currentViewWidth - boxSize.x - 10;
                    float boxPosY = 42;
                    ColorLegendBox.Draw(new Rect(boxPosX, boxPosY, boxSize.x, boxSize.y), title, colorLegend);
                }
            }
            GUILayout.EndHorizontal();

            return(BackendUtil.GetMaxRect());
        }