public void AssignNextObjective() { _currentPlaceToFind.LeavePlace (); _lastFoundPlace = _currentPlaceToFind; _currentPlaceIndex ++; if (_currentPlaceIndex >= Places.Length) { GameWin (); Invoke("LeaveLevel", 4.0f); } else { _currentPlaceToFind = Places [_currentPlaceIndex]; UIManager.Instance.ResumeGame (_currentPlaceToFind.CluePhoto); _currentPlaceToFind.Search(); } }
IEnumerator StartGame() { _inputLocked = true; _gameStarted = false; _gameEnded = false; _gameLost = false; _gamePaused = true; UIManager.Instance.StartGameUI(); Cam.AssignHolder (GeneralPanFirstCameraHolder); _timeToStart = MaxTimeToMemorize; yield return new WaitForSeconds (MaxTimeToMemorize - TimeBeforeShow); UIManager.Instance.ShowTimeToStart (); yield return new WaitForSeconds (TimeBeforeShow); UIManager.Instance.HideTimeToStart (); Cam.AssignHolder (MainCharacterCameraHolder); _timeLeft = StartTime; UIManager.Instance.ShowFadeOutText ("3", 1.0f, 0.5f); yield return new WaitForSeconds (1.0f); UIManager.Instance.ShowFadeOutText ("2", 1.0f, 0.8f); yield return new WaitForSeconds (1.0f); UIManager.Instance.ShowFadeOutText ("1", 1.0f, 1.0f); yield return new WaitForSeconds (1.0f); UIManager.Instance.ShowFadeOutText ("¡VAMOS!", 2.0f, 1.5f); yield return new WaitForSeconds (1.0f); _gameStarted = true; _currentPlaceIndex = 0; _currentPlaceToFind = Places [_currentPlaceIndex]; // first one! UIManager.Instance.ResumeGame (_currentPlaceToFind.CluePhoto); _currentPlaceToFind.Search (); ResumeGame (); }