private void OnStartSearchForQuickMatch(object model) { GPMPMatchModel matchModel = (GPMPMatchModel)model; PlayGamesPlatform.Instance.RealTime.CreateQuickGame(matchModel.minimumAmountOpponents, matchModel.maximumAmountOpponents, 0, this); LoadingController.LoadScene(LoadingController.Scenes.GPMP_WAITING_ROOM); }
public void OnMatchMakingCanceled(object obj) { DebugMP.Log("OnMatchMakingCanceled"); playerLeftOnPurpose = true; PlayGamesPlatform.Instance.RealTime.LeaveRoom(); LoadingController.LoadScene(LoadingController.Scenes.GPMP_LOBBY); }
private void OnStartInvitingForMatch(object model) { GPMPMatchModel matchModel = (GPMPMatchModel)model; PlayGamesPlatform.Instance.RealTime.CreateWithInvitationScreen(matchModel.minimumAmountOpponents, matchModel.maximumAmountOpponents, 0, this); LoadingController.LoadScene(LoadingController.Scenes.GPMP_WAITING_ROOM); }
void OnPlayerLeavesTheGame(object arg0) { DebugMP.Log("OnPlayerLeavesTheGame"); playerLeftOnPurpose = true; PlayGamesPlatform.Instance.RealTime.LeaveRoom(); LoadingController.LoadScene(LoadingController.Scenes.GPMP_LOBBY); }
public void Init() { Global.Inst.mUIRoot = mWindowRoot.transform; LoadingController mLoadCtr = Global.Inst.GetController <LoadingController>(); mLoadCtr.OpenWindow(); }
void OnGameOver(object arg0) { PlayerSave player = SaveLoadController.GetInstance().GetPlayer(); EndlessSessionSave gameSession = SaveLoadController.GetInstance().GetEndlessSession(); GooglePlayHelper gph = GooglePlayHelper.GetInstance(); player.AddTotalGamesPlayed(1); // report events gph.ReportEvent(GPGSConstant.event_amount_of_endless_games_started, 1); gph.ReportEvent(GPGSConstant.event_score_endless_mode, gameSession.GetTotalScore()); gph.ReportEvent(GPGSConstant.event_health_potions_picked_up, gameSession.GetResourcesGathered()); // save current stats gph.SaveGame(); // TODO: keep track of timeplayed // check for achievements AchievementChecker.CheckForEndlessScoreAchievement(gameSession.GetTotalScore()); AchievementChecker.CheckForWelcomeAchievement(); // highscore post if (gameSession.GetTotalScore() > player.GetHighscore()) { EventManager.TriggerEvent(EventTypes.NEW_HIGHSCORE); player.SetHighscore(gameSession.GetTotalScore()); gph.PostHighscore(player.GetHighscore(), GPGSConstant.leaderboard_endless_mode); } // start game over screen LoadingController.LoadScene(LoadingController.Scenes.GAME_OVER); }
private void CheckPassword() { if (string.IsNullOrWhiteSpace(MasterPasswordCell.TextField.Text)) { var alert = Dialogs.CreateAlert(AppResources.AnErrorHasOccurred, string.Format(AppResources.ValidationFieldRequired, AppResources.MasterPassword), AppResources.Ok); PresentViewController(alert, true, null); return; } var key = _cryptoService.MakeKeyFromPassword(MasterPasswordCell.TextField.Text, _authService.Email); if (key.Key.SequenceEqual(_cryptoService.Key.Key)) { _settings.AddOrUpdateValue(Constants.Locked, false); MasterPasswordCell.TextField.ResignFirstResponder(); LoadingController.DismissLockAndContinue(); } else { // TODO: keep track of invalid attempts and logout? var alert = Dialogs.CreateAlert(AppResources.AnErrorHasOccurred, string.Format(null, AppResources.InvalidMasterPassword), AppResources.Ok, (a) => { MasterPasswordCell.TextField.Text = string.Empty; MasterPasswordCell.TextField.BecomeFirstResponder(); }); PresentViewController(alert, true, null); } }
public virtual void ResumeSession() { if (HasSession) { if (Service.Get <ConnectionManager>().ConnectionState == ConnectionManager.NetworkConnectionState.NoConnection) { Service.Get <EventDispatcher>().DispatchEvent(default(SessionErrorEvents.NoNetworkOnResumeError)); return; } LoadingController loadingController = Service.Get <LoadingController>(); if (!loadingController.HasLoadingSystem(this)) { loadingController.AddLoadingSystem(this); } mixSession.Resume(delegate(IResumeSessionResult result) { if (!result.Success) { Service.Get <EventDispatcher>().DispatchEvent(default(SessionErrorEvents.NoSessionOnResumeError)); } else { eventDispatcher.DispatchEvent(default(SessionEvents.SessionResumedEvent)); } Service.Get <LoadingController>().RemoveLoadingSystem(this); }); } else { Service.Get <EventDispatcher>().DispatchEvent(default(SessionErrorEvents.NoSessionOnResumeError)); } }
public override IEnumerator PerformFirstPass() { splashScreen = SystemCanvas.transform.Find("SplashScreen").gameObject; Service.Set(SystemCanvas); LoadingController instance = splashScreen.AddComponent <LoadingController>(); Service.Set(instance); Service.Set(new ActionIndicatorController()); Service.Set(new UIElementDisablerManager()); notificationBreadcrumbController = new NotificationBreadcrumbController(); Service.Set(notificationBreadcrumbController); TutorialBreadcrumbController tutorialBreadcrumbController = new TutorialBreadcrumbController(); tutorialBreadcrumbController.Init(); Service.Set(tutorialBreadcrumbController); GameObject gameObject = new GameObject(); NativeSystemBarsManager instance2 = gameObject.AddComponent <NativeSystemBarsManager>(); gameObject.transform.SetParent(Service.Get <GameObject>().transform); Service.Set(instance2); InAppRatingsPrompt instance3 = Service.Get <GameObject>().AddComponent <InAppRatingsPrompt>(); Service.Set(instance3); PromptManagerRef.SetEventDispatcher(Service.Get <EventDispatcher>()); yield break; }
public override void Awake() { base.Awake(); dataEntityCollection = Service.Get <CPDataEntityCollection>(); tagsManager = Service.Get <TagsManager>(); loadingController = Service.Get <LoadingController>(); }
private void prepareForSceneTransition(string scene, string transitionScene, Dictionary <string, object> sceneArgs) { dispatcher.DispatchEvent(new SceneTransitionEvents.TransitionStart(scene)); if (MonoSingleton <NativeAccessibilityManager> .Instance.AccessibilityLevel == NativeAccessibilityLevel.VOICE) { string tokenTranslation = Service.Get <Localizer>().GetTokenTranslation("GlobalUI.Accessibility.Loading"); MonoSingleton <NativeAccessibilityManager> .Instance.Native.Speak(tokenTranslation); } LoadingController loadingController = Service.Get <LoadingController>(); loadingController.AddLoadingSystem(this); if (string.IsNullOrEmpty(transitionScene)) { transitionScene = "Loading"; } CoroutineRunner.StopTransientCoroutines(); if (sceneArgs != null) { currentSceneArgs = sceneArgs; } else { currentSceneArgs.Clear(); } }
IEnumerator TriggerGameOverScreen() { yield return(new WaitForSeconds(2)); DebugMP.Log("Game over"); LoadingController.LoadScene(LoadingController.Scenes.GPMP_GAME_OVER); }
void Start() { DontDestroyOnLoad(gameObject); learningOn = false; errorOccured = false; APP_STREAMING_ASSETS_PATH = Application.streamingAssetsPath; APP_DATA_PATH = Path.Combine(APP_STREAMING_ASSETS_PATH, "Data"); MY_COLORS_BACK_PATH = Path.Combine(APP_STREAMING_ASSETS_PATH, MY_COLORS_BACK_MAIN_FILE_NAME); SIGNALS_TRACKER_SERVER_PATH = Path.Combine(APP_STREAMING_ASSETS_PATH, SIGNALS_TRACKER_SERVER_FILE_NAME); UPDATED_QUESTIONS_DATA_PATH = Path.Combine(APP_DATA_PATH, UPDATED_QUESTIONS_DATA_FILE_NAME); UPDATED_LEARNING_DATA_PATH = Path.Combine(APP_DATA_PATH, UPDATED_LEARNING_DATA_FILE_NAME); PAST_ANSWERS_DATA_PATH = Path.Combine(APP_DATA_PATH, PAST_ANSWERS_FILE_NAME); PAST_COLORS_DATA_PATH = Path.Combine(APP_DATA_PATH, PAST_COLORS_FILE_NAME); SESSION_ERRORS_DATA_PATH = Path.Combine(APP_DATA_PATH, SESSION_ERRORS_FILE_NAME); EEG_LOGS_PATH = Path.Combine(APP_DATA_PATH, @"EEG-Logs/"); loadingData = true; SceneManager.LoadScene("Loading"); loadingController = FindObjectOfType <LoadingController>(); Thread dataInitThread = new Thread(new ThreadStart(Init)); dataInitThread.Start(); }
// /// <summary> // /// 游戏资源更新逻辑跑完; // /// Ends the deal op game up mag. // /// </summary> // void EndDealOp_GameUpMag() // { // IsNeedOtherCheck = false; // EndOp_CheckIsEndLoading (); // } /// <summary> /// Loads the scene. /// 不自动跳转的话Unity通过加载到0.9不让他加载实现。; /// </summary> /// <returns>The scene.</returns> IEnumerator loadScene() { isLoaidng = true; //异步读取场景。 // 就是A场景中需要读取的C场景名称。 string tarSence = LoadingController.GetInstance().GetCurSenceNameStr(); async = Application.LoadLevelAsync(tarSence); LoadingController.GetInstance().SetSceneLoadAsync(async); async.allowSceneActivation = false; while (async.progress < 0.9f) { SetLoadingPercentage(async.progress * 100); yield return(new WaitForEndOfFrame()); } SetLoadingPercentage(100); // yield return new WaitForEndOfFrame(); yield return(new WaitForSeconds(0f)); isLoadingSence = false; EndOp_CheckIsEndLoading(); //读取完毕后返回, 系统会自动进入C场景 async.allowSceneActivation = true // yield return async; }
async partial void SaveBarButton_Activated(UIBarButtonItem sender) { if (!_connectivity.IsConnected) { AlertNoConnection(); return; } if (string.IsNullOrWhiteSpace(PasswordCell.TextField.Text)) { DisplayAlert(AppResources.AnErrorHasOccurred, string.Format(AppResources.ValidationFieldRequired, AppResources.Password), AppResources.Ok); return; } if (string.IsNullOrWhiteSpace(NameCell.TextField.Text)) { DisplayAlert(AppResources.AnErrorHasOccurred, string.Format(AppResources.ValidationFieldRequired, AppResources.Name), AppResources.Ok); return; } var login = new Login { Uri = string.IsNullOrWhiteSpace(UriCell.TextField.Text) ? null : UriCell.TextField.Text.Encrypt(), Name = string.IsNullOrWhiteSpace(NameCell.TextField.Text) ? null : NameCell.TextField.Text.Encrypt(), Username = string.IsNullOrWhiteSpace(UsernameCell.TextField.Text) ? null : UsernameCell.TextField.Text.Encrypt(), Password = string.IsNullOrWhiteSpace(PasswordCell.TextField.Text) ? null : PasswordCell.TextField.Text.Encrypt(), Notes = string.IsNullOrWhiteSpace(NotesCell.TextView.Text) ? null : NotesCell.TextView.Text.Encrypt(), Favorite = FavoriteCell.Switch.On, FolderId = FolderCell.SelectedIndex == 0 ? null : _folders.ElementAtOrDefault(FolderCell.SelectedIndex - 1)?.Id }; var saveTask = _loginService.SaveAsync(login); var loadingAlert = Dialogs.CreateLoadingAlert(AppResources.Saving); PresentViewController(loadingAlert, true, null); await saveTask; if (saveTask.Result.Succeeded) { _googleAnalyticsService.TrackExtensionEvent("CreatedLogin"); if (LoginListController != null) { LoginListController.DismissModal(); } else if (LoadingController != null) { LoadingController.CompleteUsernamePasswordRequest(UsernameCell.TextField.Text, PasswordCell.TextField.Text, null); } } else if (saveTask.Result.Errors.Count() > 0) { DisplayAlert(AppResources.AnErrorHasOccurred, saveTask.Result.Errors.First().Message, AppResources.Ok); } else { DisplayAlert(null, AppResources.AnErrorHasOccurred, AppResources.Ok); } }
// Use this for initialization void Start() { //print("1"); if (instance == null) { instance = this; } }
public void OnPeersDisconnected(string[] participantIds) { DebugMP.Log("OnPeersDisconnected"); playerLeftOnPurpose = false; errorMessage = "Your opponent left the game"; PlayGamesPlatform.Instance.RealTime.LeaveRoom(); LoadingController.LoadScene(LoadingController.Scenes.GPMP_LOBBY); }
public LoginPage(NavController navCtrl, NavParams navParams, ToastController toastCtrl, LoadingController loadingCtrl, FormBuilder formBuilder, AuthenticationService authService) { }
private void Start() { ChooseStartingLocation(); MainHatch.IsLocked = true; SetShuttleRepaired(false); MainChar.CanAttack = false; LoadingController.AddListener(StartRecoveryDialogue); }
IEnumerator IEPlay() { LoadingController.LoadScene(1); yield return(new WaitUntil(() => !LoadingController.isLoading)); PlayfieldController.Setup(startLevel); PlayfieldController.StartSpawn(); }
/* * Functions handling on notification clicked for invitation */ public void OnInvitationReceived(Invitation invitation, bool shouldAutoAccept) { if (shouldAutoAccept) { LoadingController.LoadScene(LoadingController.Scenes.GPMP_WAITING_ROOM); PlayGamesPlatform.Instance.RealTime.AcceptInvitation(invitation.InvitationId, this); } }
public static LoadingController GetInstance() { if (instance == null) { instance = new LoadingController(); } return(instance); }
void Update() { timer += Time.deltaTime; if (timer >= duration && !readyForContinue) { readyForContinue = true; LoadingController.LoadScene(LoadingController.Scenes.MAIN_MENU); } }
IEnumerator IEQuit() { LoadingController.LoadScene(0); SaveData(); yield return(new WaitUntil(() => !LoadingController.isLoading)); saveData = LoadData(); MainMenuUIController.UpdateHUD(); }
partial void CancelBarButton_Activated(UIBarButtonItem sender) { if (LoginListController != null) { DismissViewController(true, null); } else { LoadingController.CompleteRequest(null, null); } }
private void Update() { if (loadingController == null && Service.IsSet <LoadingController>()) { loadingController = Service.Get <LoadingController>(); } float num = 0f; float num2 = 0f; num = ((loadingController == null) ? 1f : (loadingController.DownloadProgress.HasValue ? loadingController.DownloadProgress.Value : 1f)); if (bundleManager == null && Service.IsSet <BundlePrecacheManager>()) { bundleManager = Service.Get <BundlePrecacheManager>(); } num2 = ((bundleManager == null) ? 1f : ((!bundleManager.IsCaching) ? 1f : bundleManager.CompleteRatio)); num2 = num2 / 2f + num / 2f; num2 = Mathf.Lerp(0f, num2, currentTime); Vector2 anchoredPosition = fillStripes.anchoredPosition; currentTime += Time.deltaTime; currentTime %= fillStripesRepeatSeconds; float num3 = currentTime / fillStripesRepeatSeconds; float num4 = (anchoredPosition.x = num3 * fillStripesParent.rect.width); fillStripes.anchoredPosition = anchoredPosition; if (num2 >= 1f - Mathf.Epsilon) { FullProgressCompleted = true; } else if (FullProgressCompleted) { setSpecificEmoji(); FullProgressCompleted = false; isPlayingSpinner = false; } if (!FullProgressCompleted || !isPlayingSpinner) { progressBarFillRectTransform.anchorMax = new Vector2(num2, progressBarFillRectTransform.anchorMax.y); float x = num2 * progressbarWidth; emojiRectTransform.anchoredPosition = new Vector2(x, emojiRectTransform.anchoredPosition.y); int a = (int)Mathf.Max(0f, (float)tintSelector.Colors.Length * num2); uint num5 = (uint)Mathf.Min(a, tintSelector.Colors.Length - 1); tintSelector.SelectColor((int)num5); if (isGenericProgressBar && SetEmoji == null) { setEmojiIndex(num5 + 1); } if (FullProgressCompleted) { setEmojiIndex(0u); isPlayingSpinner = true; } } }
private void Cancel() { if (LoginListController != null) { DismissViewController(true, null); } else { LoadingController.CompleteRequest(null, null); } }
/// <summary> /// Ends the op check is end loading. /// 每个操作结束后都看下是否还有其他挂起的操作,没有就结束loading; /// </summary> void EndOp_CheckIsEndLoading() { //告诉控制器 场景 准备好了; LoadingController.GetInstance().LoadSenceAsyncDone(); //加载完场景后如果没有其他需要等待的操作了; // if(!IsNeedOtherCheck && !isLoadingSence) // { // isLoaidng = false; // async.allowSceneActivation = true; // LoadingController.GetInstance ().EndLoadingChangeSence (); // } }
private void Btn_Fibonacci_Click(object sender, EventArgs e) { // Check input validity if (!int.TryParse(TB_Input_Fibonacci.Text, out _)) { TB_Input_Fibonacci.Text = string.Empty; MessageBox.Show("Veuillez entrer un entier valide pour Fibonacci"); return; } // Get Fibunacci result and display a loading dialog LoadingController.ShowLoading(this, ContextEnum.Fibunacci); }
//INITIALIZATION void Start() { anim = GetComponent <Animator>(); clock = GameObject.Find("TimeManager"); timer = (TimeManager)clock.GetComponent(typeof(TimeManager)); loadingbar = GameObject.Find("Loading Bar"); load = (LoadingController)loadingbar.GetComponent(typeof(LoadingController)); changeFps(); lastEmpty = 0; full = false; anim.SetBool("trash full", false); }