Skip to content

Adds a unity-supported, SerializableType class and an inspector for editing SerializeReference fields.

License

Notifications You must be signed in to change notification settings

CareBoo/Serially

Repository files navigation

Serially




Extends the Unity Editor with type picking functionalities.

Usage

ShowSerializeReferenceAttribute

ShowSerializeReferenceAttribute

Use the ShowSerializeReferenceAttribute on a serializable field with SerializeReference to add a type picker inspector to that field.

using UnityEngine;
using CareBoo.Serially;

public class MyBehavior : MonoBehaviour
{
  [SerializeReference, ShowSerializeReference]
  public IPet myPet;
}

SerializableType

SerializableType

Serialize any type with SerializableType class.

using UnityEngine;
using CareBoo.Serially;

public class MyBehaviour : MonoBehaviour
{
  public SerializableType myType;
  
  private void Start()
  {
    Debug.Log("Serialized type is " + myType.Type.FullName);
  }
}

Installation

Scoped Registries

Registry URL
NPM https://registry.npmjs.org/
OpenUPM https://package.openupm.com

This project can be installed as a UPM package on OpenUPM or npmjs by adding those as scoped registries. See the Unity manual for more information on Scoped Registries.

Local Packages

Alternatively, you can install this directly as either a tarball or unity asset package from the latest release.

Documentation

Documentation is hosted here on GitHub pages.