Is there a list of the PropertyDrawer that comes with Unity?

So far from the Property Drawers in Unity 4 | Unity Blog article
I see there are

  • Multiline
  • Popup
  • Range
  • Compact
  • Angle

What are the others and how do I discover them?

You could use reflection to get all the classes that subclass PropertyDrawer and get your list from that.

–

Addendum: I tried this code... public void testPropertyDrawers() { //return System.Reflection.Assembly.GetAssembly().GetTypes(typeof(UnityEditor.PropertyDrawer)).Where(type => type.IsSubclassOf(UnityEditor.PropertyDrawer)). ToList(); System.Type[] ts = System.Reflection.Assembly.GetAssembly(typeof(UnityEditor.PropertyDrawer)).GetTypes(); foreach(System.Type t in ts) { if(t.IsSubclassOf(typeof(UnityEditor.PropertyDrawer))) { UnityEngine.Debug.Log("Type: " + t.Name); } } } And only find RangeDrawer and MultilineDrawer. Where would the rest be???

–

1 Answer

1

More:
This code shows more drawers

	public void testPropertyDrawers() 
	{ 
		foreach(System.Reflection.AssemblyName an in System.Reflection.Assembly.GetExecutingAssembly().GetReferencedAssemblies())
		{                      
			System.Reflection.Assembly asm = System.Reflection.Assembly.Load(an.ToString());
			foreach(System.Type type in asm.GetTypes())
			{ 
				if(type.Name.IndexOf("Drawer") >= 0)
				{
					UnityEngine.Debug.Log("Assm: " + an.Name + "  Type: " + type.Name);
				}
			}
		}
	}

Here is the list the above code found…

  • MaterialProperty
  • MaterialToggle
  • MaterialPowerSlider
  • MaterialKeyword
  • MaterialEnum
  • Custom
  • Range
  • Multiline
  • AvatarSkeleton
  • List item