ClassTypeReference

A class which provides serializable references to  of classes with an accompanying custom property drawer which allows class selection from drop-down.

This source code is licensed under the open source MIT license and is hosted in a Git repository on Bitbucket: https://bitbucket.org/rotorz/classtypereference-for-unity

Whilst we have not encountered any platform specific issues yet, the source code in this repository might not necessarily work for all of Unity's platforms or build configurations. It would be greatly appreciated if people would report issues using the issue tracker.

Usage Examples
Type references can be made using the inspector simply by using :

You can apply one of two attributes to drastically reduce the number of types presented when using the drop-down field.

To create an instance at runtime you can use the  class from the .NET / Mono library:

Presentation of drop-down list can be customized by supplying a  value to either of the attributes   or.


 * ClassGrouping.None - No grouping, just show type names in a list; for instance, "Some.Nested.Namespace.SpecialClass".


 * ClassGrouping.ByNamespace - Group classes by namespace and show foldout menus for nested namespaces; for instance, "Some > Nested > Namespace > SpecialClass".


 * ClassGrouping.ByNamespaceFlat (default) - Group classes by namespace; for instance, "Some.Nested.Namespace > SpecialClass".


 * ClassGrouping.ByAddComponentMenu - Group classes in the same way as Unity does for its component menu. This grouping method must only be used for  types.

For instance,