private void Awake() { //persistent singleton if (instance == null) { instance = this; DontDestroyOnLoad(this); } else { if (this != instance) { Destroy(this.gameObject); } } if (BinarySerialization.LoadFromPlayerPrefs(SavingKeysContainer.SAVE1_ID) == null) { BinarySerialization.SaveToPlayerPrefs(SavingKeysContainer.SAVE1_ID, false); } if (BinarySerialization.LoadFromPlayerPrefs(SavingKeysContainer.SAVE2_ID) == null) { BinarySerialization.SaveToPlayerPrefs(SavingKeysContainer.SAVE2_ID, false); } if (BinarySerialization.LoadFromPlayerPrefs(SavingKeysContainer.SAVE3_ID) == null) { BinarySerialization.SaveToPlayerPrefs(SavingKeysContainer.SAVE3_ID, false); } }
private void Awake() { //persistent singleton if(instance == null) { instance = this; DontDestroyOnLoad(this); } else { if(this != instance) Destroy(this.gameObject); } if (BinarySerialization.LoadFromPlayerPrefs (SavingKeysContainer.SAVE1_ID) == null) BinarySerialization.SaveToPlayerPrefs (SavingKeysContainer.SAVE1_ID, false); if (BinarySerialization.LoadFromPlayerPrefs (SavingKeysContainer.SAVE2_ID) == null) BinarySerialization.SaveToPlayerPrefs (SavingKeysContainer.SAVE2_ID, false); if (BinarySerialization.LoadFromPlayerPrefs (SavingKeysContainer.SAVE3_ID) == null) BinarySerialization.SaveToPlayerPrefs (SavingKeysContainer.SAVE3_ID, false); }