private void CarEvent(SimpleDialogPromptViewController viewController, bool ok) { viewController.didFinishEvent -= CarEvent; if (viewController.isRebuildingHierarchy) { return; } FlyingCar.startflyingCars = ok; viewController.DismissModalViewController(null, false); }
private void Warning_didFinishEvent(SimpleDialogPromptViewController viewController, bool ok) { viewController.didFinishEvent -= this.Warning_didFinishEvent; if (ok) { viewController.DismissModalViewController(null, false); } else { Application.Quit(); } }
/* * IEnumerator LoadWarning() * { * string warningText = "The folling plugins are obsolete:\n"; * * foreach(var text in warningPlugins) * { * warningText += text + ", "; * } * warningText = warningText.Substring(0, warningText.Length - 2); * * warningText +="\nPlease remove them before playing or you my encounter errors.\nDo you want to continue?"; * * yield return new WaitForSeconds(0.1f); * * var _menuMasterViewController = Resources.FindObjectsOfTypeAll<StandardLevelSelectionFlowCoordinator>().First(); * var warning = ReflectionUtil.GetPrivateField<SimpleDialogPromptViewController>(_menuMasterViewController , "_simpleDialogPromptViewController"); * warning.gameObject.SetActive(false); * warning.didFinishEvent += Warning_didFinishEvent; * warning.Init("Plugin warning", warningText, "YES", "NO"); * * yield return new WaitForSeconds(0.1f); * * _mainMenuViewController.PresentModalViewController(warning, null, false); * } * * private void Warning_didFinishEvent(SimpleDialogPromptViewController viewController, bool ok) * { * viewController.didFinishEvent -= Warning_didFinishEvent; * if (viewController.isRebuildingHierarchy) * { * return; * } * if (ok) * { * viewController.DismissModalViewController(null, false); * } * else * { * Application.Quit(); * } * } */ private void Prompt_didFinishEvent(SimpleDialogPromptViewController viewController, bool ok) { viewController.didFinishEvent -= Prompt_didFinishEvent; if (viewController.isRebuildingHierarchy) { return; } if (ok) { //Console.WriteLine("OK"); } else { //Console.WriteLine("NO"); } viewController.DismissModalViewController(null, false); }