public void Cancel() { if (GameManager.Instance.oldConfig != null) { GameManager.Instance.GameConfig = GameManager.Instance.oldConfig; } else { GameManager.Instance.GameConfig = ConfigFactory.CreateEasyLevel(); } GameManager.Instance.fader.LoadSceneFading("configChoice"); }
// Use this for initialization public void Initialize() { /* We want this to persist through game life */ DontDestroyOnLoad(this); try { if (!Directory.Exists(Application.persistentDataPath + "/configs")) { Directory.CreateDirectory(Application.persistentDataPath + "/configs"); } } catch (IOException e) { Debug.Log(e.Message); } _currentLevel = 1; if (_config == null) { _config = ConfigFactory.CreateEasyLevel(); } fader = GetComponent <Fader>(); if (fader == null) { fader = gameObject.AddComponent <Fader>(); } this.ResultsList = new List <LevelResult>(); AudioSource[] sounds = GetComponents <AudioSource>(); backMusic = sounds[0]; titleMusic = sounds[1]; gameFinishedSound = sounds[2]; levelFinishedSound = sounds[3]; restartSound = sounds[4]; Debug.Log("Game started"); initialized = true; }
public void EasyLevelChoose() { selectedConfigName = ""; GameManager.Instance.GameConfig = ConfigFactory.CreateEasyLevel(); this.HideButtons(); }