UnitySerializedReferenceUI/README.md

55 lines
2.0 KiB
Markdown
Raw Permalink 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:44:09 +01:00
2022-03-26 11:42:57 +01:00
https://github.com/TextusGames/UnitySerializedReferenceUI.git
2022-03-26 11:44:39 +01:00
2022-03-26 11:22:30 +01:00
<img width="464" alt="image" src="https://user-images.githubusercontent.com/34438607/160235251-c6af2ee5-694d-4b38-9ab4-0ddca73f686b.png">
2022-03-26 11:43:44 +01:00
2022-03-26 11:42:57 +01:00
<img width="230" alt="image" src="https://user-images.githubusercontent.com/34438607/160235894-8a1e2bd9-fe93-463d-aa6f-6d4634cc7457.png">
2022-03-26 11:40:16 +01:00
Or add id to your `packages.json` file manually (located inside the project's Packages folder).
2022-03-26 11:38:17 +01:00
```json
"com.textus-games.serialized-reference-ui": "https://github.com/TextusGames/UnitySerializedReferenceUI.git"
```
## 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.