3using System.Reflection;
7using System.Collections.Generic;
22 private GameObject currentSelection;
28 private List<pb_ComponentEditor> componentEditors =
new List<pb_ComponentEditor>();
31 private static HashSet<System.Type> userIgnoredTypes =
new HashSet<System.Type>();
38 userIgnoredTypes.Add(type);
46 userIgnoredTypes.Remove(type);
57 void UndoRedoPerformed()
59 foreach(pb_ComponentEditor editor
in componentEditors)
65 void OnSelectionChange(IEnumerable<GameObject> selection)
68 if(currentSelection != pb_Selection.activeGameObject)
71 currentSelection = pb_Selection.activeGameObject;
84 if (rename && !
string.IsNullOrEmpty(rename.NewName))
88 GameObject panel1 = pb_GUIUtility.CreateLabeledVerticalPanel(goName);
93 if( component ==
null ||
94 userIgnoredTypes.Contains(component.GetType()) ||
95 pb_Reflection.HasIgnoredAttribute(component.GetType()) ||
97 (!
showUnityComponents && pb_Config.IgnoredComponentsInInspector.Contains(component.GetType())))
100 string panelLabelTitleString = component.GetType().ToString();
108 if (attr.
name !=
null && attr.
name.Length > 0)
110 panelLabelTitleString = attr.
name;
115 GameObject panel = pb_GUIUtility.CreateLabeledVerticalPanel(panelLabelTitleString);
123 inspector = pb_ComponentEditorResolver.GetEditor(component);
125 inspector.transform.SetParent(panel.transform);
127 componentEditors.Add(inspector);
131 void ClearInspector()
134 pb_ObjectUtility.Destroy(go.gameObject);
136 componentEditors.Clear();
UnityEngine.Component Component
GameObject inspectorScrollPanel
static void AddIgnoredType(System.Type type)
void ToggleInspector(bool show)
void RebuildInspector(GameObject go)
static void RemoveIgnoredType(System.Type type)
bool showUnityComponents
By default don't show the Unity components.
static void AddRedoPerformedListener(Callback callback)
static void AddUndoPerformedListener(Callback callback)
static void AddOnSelectionChangeListener(Callback< IEnumerable< GameObject > > del)