UnitySerializedReferenceUI/README.md

47 lines
1.7 KiB
Markdown
Raw Normal View History

2020-05-16 11:33:46 +02:00
# UnitySerializedReferenceUI
The UI for Unity's SerealizedReference attribute. It allows to change the instance type of field right in editor.
2020-05-16 12:20:45 +02:00
Project is provided under Mit license which you can find in inner main folder ("SerializedReferenceUI")
2020-05-16 19:24:41 +02:00
Known limitations.
2020-05-26 10:26:53 +02:00
- Custom property drawer has no effect. Becouse property is drawn from custom attribute drawer custom property drawer is not applied (unity default behaviour).
2020-08-13 16:31:20 +02:00
- Can not serialized types derived from UnityEngine.Object (monbehaviour, scriptableObject) (unity's limitation).
- Can not create instance of class that does not have empty constructor(only have private for example).
2020-05-16 19:24:41 +02:00
2020-05-26 10:19:59 +02:00
Known Issues of serialized reference:
2020-05-26 10:26:53 +02:00
- Renaming used type can produce data loss and throws unknown managed type exception. This is unity's bug.
- SerializeReference itself is not working properly with Prefab Instances;
2020-05-16 19:26:50 +02:00
Future plans:
Possibly
- copy / paste.
- menu with searchbar.
## Installation
Use the + inside the Package Manager window and add this URL:
2022-03-26 11:18:10 +01:00
![image](https://user-images.githubusercontent.com/34438607/160235117-ad528c60-0198-49b3-a0fc-d744ef5ac61b.png)
```json
"com.textus-games.serialized-reference-ui": "https://github.com/popcron/UnitySerializedReferenceUI.git"
```
Or add id to your `packages.json` file manually (located inside the project's Packages folder).
## Example
![Woah UI woah woah!!!](https://cdn.discordapp.com/attachments/784916261871550494/847185548632260628/unknown.png)
```cs
[Serializable]
public class Slot
{
[SerializeReference, SerializeReferenceButton]
public Item item;
}
[Serializable]
public class Item {}
public class Metal : Item {}
public class Wood : Item {}
```
2022-03-26 11:18:10 +01:00
For more examples, this package contains two Samples that can be imported into your project.