Centralized data storage solution with full support for Unity's serialization and ScriptableObject's.
Simply import it in Unity with the Unity Package Manager using this URL:
https://github.com/DatLycan/Unity-RepositorySystem.git
public class MyRepo : IRepository {
public string MyString = "My String!";
}
public class MyClass : MonoBehaviour {
private readonly Reference<MyRepo> reference = new();
private void Start() => Debug.Log(reference.Repository.MyString);
}
When Unity serializes Reference<T>
, it displays a dropdown of classes that inherit from T
, or T
itself if it is not abstract.