void Start() { this.gameS = GameObject.FindObjectOfType <GameState15O>(); levelSelectorPanel = GameObject.FindGameObjectWithTag("LevelSelector"); levelSelectorPanel.SetActive(true); diccionary = new SortedDictionary <string, int>(); answered = new SortedDictionary <string, int>(); simpleDictionary = new SortedDictionary <string, int>(); lista.SetActive(false); finalPanel.SetActive(false); textBx.gameObject.SetActive(false); A.SetActive(false); B.SetActive(false); string path; if (gameS.fileConfig) { path = @".\configFile15O.txt"; if (!File.Exists(path)) { // Note that no lock is put on the // file and the possibility exists // that another process could do // something with it between // the calls to Exists and Delete. fs = File.Create(path); Byte[] info = new UTF8Encoding(true).GetBytes("A"); fs.Write(info, 0, info.Length); fs.Close(); } System.IO.StreamReader file = new System.IO.StreamReader(path); string option = file.ReadLine(); Debug.Log(option); file.Close(); SetLevel(option); gameS.fileConfig = false; } path = @".\Resultados.txt"; if (File.Exists(path)) { // Note that no lock is put on the // file and the possibility exists // that another process could do // something with it between // the calls to Exists and Delete. File.Delete(path); } fs = File.Create(path); }
private void Awake() { if (gameState == null) { gameState = this; DontDestroyOnLoad(gameObject); } else if (gameState != this) { Destroy(gameObject); } this._fileConfig = false; }