So I have an ScriptableObject called SpriteLibrary, in which I’ll load some Sprites for my game.
This class contains a List of “SpriteObject”, an object that has a sprite, and a type.
All classes and fields are Serializable, so what I have in my inspector is:
Things looks fine, however, when I click “Play”, those values I set on the inspector are not being loaded to the game. My SpriteObject list is still empty.
Here’s how I instantiated it:
[SerializeField]
List<SpriteObject> spriteList = new List<SpriteObject>();
And this is my SpriteObject class:
[System.Serializable]
public class SpriteObject
{
[SerializeField]
public Sprite sprite;
[SerializeField]
public string type;
[SerializeField]
public int tier;
}
Could I be missing something on this?
Do I need to add these items to the List manually somehow?
Thanks in advance guys!!
