private void Awake() { if (Instance == null) { Instance = this; } else if (Instance != this) { Destroy(gameObject); } DontDestroyOnLoad(gameObject); Load(); Debug.Log(HelperScript.Serialize <SaveState>(state)); }
//Save the whole state of this saveState script to the player prefab public void Save() { PlayerPrefs.SetString("save", HelperScript.Serialize <SaveState>(state)); }
public void Save() { m_saveState.m_highScore = GameController.Instance.m_highScore; PlayerPrefs.SetString("Save", HelperScript.Serialize <SaveState>(m_saveState)); }