private void ShowResults(VRUIViewController parentViewController) { if (_resultsFlowCoordinator == null) { _resultsFlowCoordinator = Resources.FindObjectsOfTypeAll <ResultsFlowCoordinator>().First(); } _resultsFlowCoordinator.didFinishEvent += HandleResultsFlowCoordinatorDidFinish; _resultsFlowCoordinator.Present(parentViewController, StaticData.LastLevelCompletionResults, StaticData.LastLevelPlayed, GameplayOptions.defaultOptions, GameplayMode.SoloStandard); StaticData.LastLevelCompletionResults = null; StartCoroutine(WaitForResults()); }
public void Present(VRUIViewController parentViewController, bool fromDebug) { _ui = TwitchIntegrationUi.Instance; _logger = LogManager.GetCurrentClassLogger(); try { _menuSceneSetupData = Resources.FindObjectsOfTypeAll <MenuSceneSetupData>().First(); _mainGameSceneSetupData = Resources.FindObjectsOfTypeAll <MainGameSceneSetupData>().First(); _resultsFlowCoordinator = Resources.FindObjectsOfTypeAll <ResultsFlowCoordinator>().First(); if (_levelRequestNavigationController == null) { _levelRequestNavigationController = _ui.CreateViewController <LevelRequestNavigationController>("LevelRequestNavController"); } if (_requestInfoViewController == null) { _requestInfoViewController = _ui.CreateViewController <RequestInfoViewController>("RequestInfo"); _requestInfoViewController.rectTransform.anchorMin = new Vector2(0.3f, 0f); _requestInfoViewController.rectTransform.anchorMax = new Vector2(0.7f, 1f); } _levelDifficultyViewController = Resources.FindObjectsOfTypeAll <StandardLevelDifficultyViewController>().First(); _levelDetailViewController = Resources.FindObjectsOfTypeAll <StandardLevelDetailViewController>().First(); } catch (Exception e) { _logger.Error("Unable to load UI components: " + e); return; } if (!_initialized) { DidFinishEvent += Finish; _levelRequestNavigationController.DidFinishEvent += HandleLevelRequestNavigationControllerDidfinish; _levelDifficultyViewController.didSelectDifficultyEvent += HandleDifficultyViewControllerDidSelectDifficulty; _levelDetailViewController.didPressPlayButtonEvent += HandleDetailViewControllerDidPressPlayButton; _requestInfoViewController.DownloadButtonpressed += HandleDidPressDownloadButton; _requestInfoViewController.SkipButtonPressed += HandleDidPressSkipButton; _initialized = true; } //_levelRequestNavigationController.Init(); parentViewController.PresentModalViewController(_levelRequestNavigationController, null, StaticData.DidStartFromQueue); _requestInfoViewController.Init("Default Song Name", "Default User"); _levelRequestNavigationController.PushViewController(_requestInfoViewController, true); if (!fromDebug) { return; //Loading song preview arrests control from the results controller, causing it to display improperly. } CheckQueueAndUpdate(); }