The UI for Unity's SerealizedReference attribute. It allows to change the instance type of field right in editor.
Project is provided under Mit license which you can find in inner main folder ("SerializedReferenceUI")
Known limitations.
Known Issues of serialized reference:
Future plans: Possibly
Use the + inside the Package Manager window and add this URL:
https://github.com/TextusGames/UnitySerializedReferenceUI.git
Or add id to your packages.json
file manually (located inside the project's Packages folder).
"com.textus-games.serialized-reference-ui": "https://github.com/TextusGames/UnitySerializedReferenceUI.git"
[Serializable]
public class Slot
{
[SerializeReference, SerializeReferenceButton]
public Item item;
}
[Serializable]
public class Item {}
public class Metal : Item {}
public class Wood : Item {}
For more examples, this package contains two Samples that can be imported into your project.