public void Refresh() { if (IsBound) { if (currentDrawer == null) { m_inspectedObject = null; } else { currentDrawer.Refresh(); } } }
public void Inspect(object obj) { if (inspectLock) { return; } isDirty = false; if (OnInspectedObjectChanging != null) { obj = OnInspectedObjectChanging(m_inspectedObject, obj); } if (m_inspectedObject == obj) { return; } StopInspect(); inspectLock = true; try { m_inspectedObject = obj; if (obj.IsNull()) { return; } #if UNITY_EDITOR || !NETFX_CORE if (obj.GetType().IsValueType) #else if (obj.GetType().GetTypeInfo().IsValueType) #endif { m_inspectedObject = null; Debug.LogError("Can't inspect a value type!"); return; } if (!gameObject.activeSelf) { m_inspectedObject = null; Debug.LogError("Can't inspect while Inspector is inactive!"); return; } InspectorField inspectedObjectDrawer = CreateDrawerForType(obj.GetType(), drawArea, 0, false); if (inspectedObjectDrawer != null) { inspectedObjectDrawer.BindTo(obj.GetType(), string.Empty, () => m_inspectedObject, (value) => m_inspectedObject = value); inspectedObjectDrawer.NameRaw = obj.GetNameWithType(); inspectedObjectDrawer.Refresh(); if (inspectedObjectDrawer is ExpandableInspectorField) { ((ExpandableInspectorField)inspectedObjectDrawer).IsExpanded = true; } currentDrawer = inspectedObjectDrawer; GameObject go = m_inspectedObject as GameObject; if (go == null && m_inspectedObject is Component) { go = ((Component)m_inspectedObject).gameObject; } if (!ConnectedHierarchy.IsNull() && (go == null || !ConnectedHierarchy.Select(go.transform))) { ConnectedHierarchy.Deselect(); } } else { m_inspectedObject = null; } } finally { inspectLock = false; } }