void Start() { Countdown.onCountdownEnd.AddListener(EnableBoard); onGameReset.AddListener(Reset); onGameStart.AddListener(StartGame); difficultySettingsData = new DifficultySettingsData(); InitialiseStatPlayerPrefs(); onGameReset.Invoke(); customSettingInfo = difficultySettingsData.Difficulties.CustomPlayerPref; if (!PlayerPrefs.HasKey(customSettingInfo.Col.Name)) { PlayerPrefs.SetInt(customSettingInfo.Col.Name, customSettingInfo.Col.InitialValue); } if (!PlayerPrefs.HasKey(customSettingInfo.Row.Name)) { PlayerPrefs.SetInt(customSettingInfo.Row.Name, customSettingInfo.Row.InitialValue); } Difficulty currentGameDifficulty = GameDifficulty.gameDifficulty.GetCurrentGameDifficulty(); onGameStart.Invoke(GetDifficultyInfo(currentGameDifficulty)); DontDestroyOnLoadManager.RemoveObj(GameDifficulty.gameDifficulty.gameObject); }
public void DestroyOnLoad() { DontDestroyOnLoadManager.RemoveObj(gameObject); }