void Awake() { localBest = PlayerPrefs.GetInt("localbest", 0); localBestUI.text = localBest + ""; worldBest = PlayerPrefs.GetInt("worldbest", localBest); worldBestUI.text = worldBest + ""; board = GetComponent <GameBoard>(); puzzles = GetComponent <PuzzleManager>(); legal = GetComponent <LegalMoves>(); ai = GetComponent <AI>(); cam = Camera.main; inGameMode = !DeveloperMode.InDevMode(); }
void Start() { if (DeveloperMode.InDevMode()) { legalMoves = GetComponent <LegalMoves>(); board = GetComponent <GameBoard>(); devMode = GetComponent <DeveloperMode>(); StreamReader reader = new StreamReader("Assets/Puzzles/PGN.txt"); CustomMethods.MeasureExecutionTime(false); pgn = reader.ReadToEnd(); CustomMethods.MeasureExecutionTime(true); reader.Close(); ReadPGN(pgn); } }
void Awake() { if (!DeveloperMode.InDevMode()) { /* * List<string> puzzlesList = new List<string>(); * //puzzles = new string[puzzleDifficultyCount][]; * //for (int i = 0; i < puzzleDifficultyCount; i ++) * //puzzlesList[i] = new List<string>(); * * StreamReader reader = new StreamReader("Assets/Puzzles/Puzzles.txt"); * while (reader.Peek() >= 0) { * string line = reader.ReadLine(); * puzzlesList.Add(line); * } * puzzles = CustomMethods.ShuffleArray<string>(puzzlesList.ToArray()); * * reader.Close(); */ puzzles = fenText.text.Split(new char[] { '\n' }, System.StringSplitOptions.RemoveEmptyEntries); puzzles = CustomMethods.ShuffleArray <string>(puzzles); } }