2024年1月25日发(作者:)

DrawDefaultInspector(); Type type = e(); var exposedProperties = perties(lic | | ce). Where(item => ned(typeof(ExposePropertyAttribute), true)).ToArray(); if ( > 0) { tor(); ield("Properties", bel); foreach (PropertyInfo propertyInfo in exposedProperties) { DrawProperty(propertyInfo); } } if (d) { ty(target); } } private void DrawProperty(PropertyInfo propertyInfo) { try { bool hasGetMethod = Method(true) != null; if (!hasGetMethod) {

return; }

bool hasSetMethod = Method(true) != null; d = hasSetMethod; object value = (tyType, , ue(target, null)); if (hasSetMethod) { ue(target, value, null); } } catch (Exception exception) { ield(ng()); } } } public static class TypeDrawer { public static object Draw(Type type, string name, object getValue) { object value = null; if (typeof(int) == type) { value = ld(name, (int)getValue); } else if (typeof(long) == type) { value = eld(name, (long)getValue); } else if (typeof(float) == type) { value = ield(name, (float)getValue); } else if (typeof(string) == type) { value = eld(name, (string)getValue); } else if (typeof(bool) == type) { value = (name, (bool)getValue); } else if (typeof(Vector2) == type)

else if (typeof(Vector2) == type) { value = 2Field(name, (Vector2)getValue); } else if (typeof(Vector3) == type) { value = 3Field(name, (Vector3)getValue); } else if (typeof(Vector4) == type) { value = 4Field(name, (Vector4)getValue); } else if () { if (ned(typeof(FlagsAttribute), true)) value = agsField(name, (Enum)getValue); else value = pup(name, (Enum)getValue); } else if (typeof().IsAssignableFrom(type)) { value = Field(name, ()getValue, type, true); } return value; } }}