public override void initialize() { base.initialize(); _wantsIndentWhenDrawn = true; var material = getValue <Material>(); if (material == null) { return; } // fetch our inspectors and let them know who their parent is _inspectors = TypeInspectorUtils.getInspectableProperties(material); // if we are a Material<T>, we need to fix the duplicate Effect due to the "new T effect" if (ReflectionUtils.isGenericTypeOrSubclassOfGenericType(material.GetType())) { var didFindEffectInspector = false; for (var i = 0; i < _inspectors.Count; i++) { var isEffectInspector = _inspectors[i] is EffectInspector; if (isEffectInspector) { if (didFindEffectInspector) { _inspectors.RemoveAt(i); break; } didFindEffectInspector = true; } } } }
void drawNullMaterial() { if (NezImGui.CenteredButton("Create Material", 0.5f, ImGui.GetStyle().IndentSpacing * 0.5f)) { var material = new Material(); setValue(material); _inspectors = TypeInspectorUtils.getInspectableProperties(material); } }
public override void initialize() { base.initialize(); var effect = getValue <Effect>(); _name += $" ({effect.GetType().Name})"; var inspectors = TypeInspectorUtils.getInspectableProperties(effect); foreach (var inspector in inspectors) { // we dont need the Name field. It serves no purpose. if (inspector.name != "Name") { _inspectors.Add(inspector); } } }