private void ListAddItem(object value = null) { var drawer = new MethodPropertyDrawer(elementType, "", value, true, false); drawer.OnRequireRedraw += RequireRedraw; arrayContentDrawer.Add(drawer); }
private void InternalOpen(object target, Type targetType, bool showProps, bool showPrivate, bool showObsolete, bool showMethods, bool updateProps, MethodPropertyDrawer parent) { titleContent = new GUIContent($"{target ?? targetType} - Inspector+"); drawer = InspectorDrawer.GetDrawer(target, targetType, true, showProps, showPrivate, showObsolete, showMethods); drawer.OnRequireRedraw += Repaint; this.parent = parent; this.updateProps = updateProps; ShowUtility(); UpdateValues(); isReadOnly = parent != null && parent.IsReadOnly && parent.requiredType != null && parent.requiredType.IsValueType; }
private void DrawRequestRefs() { MethodPropertyDrawer removal = null; foreach (var drawer in MethodPropertyDrawer.drawerRequestingReferences) { if (drawer.requiredType.IsAssignableFrom(targetType) && GUILayout.Button($"Assign this object to {drawer.name}")) { drawer.Value = target; drawer.SetDirty(); removal = drawer; } } if (removal != null) { MethodPropertyDrawer.drawerRequestingReferences.Remove(removal); } }
public static void OpenStatic(Type targetType, bool showProps, bool showPrivate, bool showObsolete, bool showMethods, bool updateProps, MethodPropertyDrawer parent) => CreateInstance <InspectorChildWindow>().InternalOpen(null, targetType, showProps, showPrivate, showObsolete, showMethods, updateProps, parent);