static LSScenePropertyDrawer() { List <Type> drawerTypes = LSEditorUtility.GetFilteredTypes(typeof(LSScenePropertyDrawer)); foreach (Type type in drawerTypes) { LSScenePropertyDrawer drawer = (LSScenePropertyDrawer)Activator.CreateInstance(type); Type targetType = drawer.TargetType; MappedDrawers.Add(targetType, drawer); } }
private static IEnumerable<LSScenePropertyDrawer> GetPropertyDrawers(SerializedProperty p) { Type propertyObjectType = LSEditorUtility.GetPropertyType(p); if (propertyObjectType == null) yield break; LSScenePropertyDrawer drawer = LSScenePropertyDrawer.GetDrawer(propertyObjectType); yield return drawer; IEnumerable<PropertyAttribute> propertyAttributes = LSEditorUtility.GetPropertyAttributes<PropertyAttribute>(p); foreach (PropertyAttribute propertyAttribute in propertyAttributes) { drawer = LSScenePropertyDrawer.GetDrawer(propertyAttribute.GetType()); yield return drawer; } }