예제 #1
0
    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;
    }
예제 #2
0
    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);
    }