public PostProcessorInspector(PostProcessor postProcessor) { _postProcessor = postProcessor; _inspectors = TypeInspectorUtils.GetInspectableProperties(postProcessor); // if we are a Material<T>, we need to fix the duplicate Effect due to the "new T effect" if (ReflectionUtils.IsGenericTypeOrSubclassOfGenericType(_postProcessor.GetType())) { var didFindEffectInspector = false; for (var i = 0; i < _inspectors.Count; i++) { var isEffectInspector = _inspectors[i] is Nez.ImGuiTools.TypeInspectors.EffectInspector; if (isEffectInspector) { if (didFindEffectInspector) { _inspectors.RemoveAt(i); break; } didFindEffectInspector = true; } } } for (var i = 0; i < _inspectors.Count; i++) { var effectInspector = _inspectors[i] as Nez.ImGuiTools.TypeInspectors.EffectInspector; if (effectInspector != null) { effectInspector.AllowsEffectRemoval = false; } } }
public ComponentInspector(ECComponent component) { _component = component; _inspectors = TypeInspectorUtils.GetInspectableProperties(component); if (_component.GetType().IsGenericType) { var genericType = _component.GetType().GetGenericArguments()[0].Name; _name = $"{_component.GetType().BaseType.Name}<{genericType}>"; } else { _name = _component.GetType().Name; } var methods = TypeInspectorUtils.GetAllMethodsWithAttribute <InspectorDelegateAttribute>(_component.GetType()); foreach (var method in methods) { // only allow zero param methods if (method.GetParameters().Length == 0) { _componentDelegateMethods.Add((Action)Delegate.CreateDelegate(typeof(Action), _component, method)); } } }
public override void Initialize() { // we need something to inspect here so if we have a null object create a new one object obj = GetValue(); if (obj == null && _valueType.GetConstructor(Type.EmptyTypes) != null) { obj = Activator.CreateInstance(_valueType); } if (obj != null) { _inspectors = TypeInspectorUtils.GetInspectableProperties(obj); } else { _inspectors = new List <AbstractTypeInspector>(); } }
public PostProcessorInspector(PostProcessor postProcessor) { _postProcessor = postProcessor; _inspectors = TypeInspectorUtils.getInspectableProperties(postProcessor); }
public override void Initialize() { this.obj = GetValue <T>(); this.inspectors = TypeInspectorUtils.GetInspectableProperties(this.obj); }
ObjInspectorSpawn(object obj) { this.obj = obj; this.inspectors = TypeInspectorUtils.GetInspectableProperties(obj); }
public ComponentInspector(Component component) { _component = component; _inspectors = TypeInspectorUtils.getInspectableProperties(component); }