I’m using scriptable objects to build a set of actions and resources, and I’ve loaded these into two lists using the editor interface.
The parent object DataController is the first thing to load (as a persistent object in the first scene), but even polling the list property on the first line of its create method returns an empty list:
[SerializeField]
public class DataController : MonoBehaviour {
public Resource resourceList;
public Action actionList;
private PlayerData playerData;
private string gameDataFileName = “data.json”;
// Use this for initialization
void Start () {
Debug.LogWarning(actionList);
Debug.LogWarning(resourceList);
…
Both debug warnings return empty lists
I’m pretty new to Unity so I must be missing something here in how either scriptable objects or the editor itself works. Anyone have any ideas? Many thanks.
EDIT: Fixed by changing Arrays to List<> objects. Not sure exactly arrays wouldn’t work though.