public void Load(string json) { SerializableStoreButton saved = JsonUtility.FromJson <SerializableStoreButton>(json); print(name + " is setting its saved state to " + saved.state); state = (Moth.StoreButtonState)saved.state; }
public string Save() { print(name + " is savings its saved state to " + state); SerializableStoreButton saveable = new SerializableStoreButton { state = (int)state, }; string json = JsonUtility.ToJson(saveable); return(json); }