private IEnumerator InitializeBubbleCoroutine(string path, GameObject prefab) { bubble = UnityEngine.Object.Instantiate(prefab); bubble.SetActive(value: false); Transform jnt = null; while (jnt == null) { jnt = base.transform.Find("hips_jnt/backbone_jnt/chest_jnt/neck_jnt"); yield return(new WaitForEndOfFrame()); } CameraFacingController cameraFacingController = bubble.GetComponent <CameraFacingController>(); if (cameraFacingController != null) { cameraFacingController.AttachPoint = jnt; bubble.transform.SetParent(base.gameObject.transform, worldPositionStays: false); } else { bubble.transform.SetParent(jnt.transform, worldPositionStays: false); bubble.transform.position = jnt.transform.position; } bubble.SetActive(value: true); swimController = GetComponent <SwimController>(); bubbleMaterial = bubble.GetComponentInChildren <MeshRenderer>().material; float totalAirQuantity = 10f - AirThreshold; warningThreshold = AirThreshold + totalAirQuantity * 0.4f; dangerThreshold = AirThreshold + totalAirQuantity * 0.2f; bubbleState = getStartingBubbleState(AirSupply); updateBubbleState(); if (isLocalPlayer) { CoroutineRunner.Start(UpdateLocalPlayerBubbleCoRoutine(), this, "UpdateLocalPlayerBubbleCoRoutine"); CoroutineRunner.Start(SyncAirSupplyNetwork(), this, "SyncAirSupplyNetwork"); yield break; } DataEntityHandle handle = GetComponent <AvatarDataHandle>().Handle; if (!handle.IsNull) { AirBubbleData component = dataEntityCollection.GetComponent <AirBubbleData>(handle); if (component != null) { dataEntityCollection.GetComponent <AirBubbleData>(handle).AirBubbleChanged += OnRemotePlayerAirBubbleChanged; } else { Log.LogError(this, "Failed to get the air bubble data for the remote player"); } } }
private IEnumerator runTests() { yield return(CoroutineRunner.Start(add_VerifyDoesContain(), this, "add_VerifyDoesContain")); yield return(CoroutineRunner.Start(stopAllForOwner_VerifyDidStop(), this, "stopAllForOwner_VerifyDidStop")); yield return(CoroutineRunner.Start(stopAll_VerifyDidStop(), this, "stopAll_VerifyDidStop")); yield return(CoroutineRunner.Start(stopAll_VerifyMultipleDidStop(), this, "stopAll_VerifyMultipleDidStop")); IntegrationTest.Pass(); }
private IEnumerator add_VerifyDoesContain() { CoroutineOwnerMap <RadicalCoroutine> map = new CoroutineOwnerMap <RadicalCoroutine>(); ICoroutine coroutine = CoroutineRunner.Start(testerCoroutine(), this, "testerCoroutine"); IntegrationTestEx.FailIf(map.GetCountForOwner(this) != 0); map.Add(this, (RadicalCoroutine)coroutine); IntegrationTestEx.FailIf(map.GetCountForOwner(this) != 1); map.Add(this, (RadicalCoroutine)coroutine); IntegrationTestEx.FailIf(map.GetCountForOwner(this) != 1); yield return(coroutine); }
protected override void setWidgetData(CellPhoneActivityDefinition widgetData) { CellPhoneSaleActivityDefinition x = widgetData as CellPhoneSaleActivityDefinition; if (x != null) { saleData = x; setEndTime(saleData); setSaleDiscount(saleData); CoroutineRunner.Start(updateTimer(), this, "updateTimer"); } }
private void tweenCountText() { originalCountTextPosition = CountPanel.transform.position; CountPanel.transform.position = CountPanel.transform.position + new Vector3(0f, -2f, 0f); Tweenable countPanel = CountPanel; countPanel.TweenCompleteAction = (Action <GameObject>)Delegate.Combine(countPanel.TweenCompleteAction, new Action <GameObject>(onTweenComplete)); CountPanel.TweenPosition(originalCountTextPosition, 1f); CountPanel.transform.localScale = Vector3.zero; CountPanel.TweenScale(Vector3.one, 1f); CoroutineRunner.Start(restoreCountTextAlpha(), this, ""); }
public void OnEnable() { isInitialized = false; if (string.IsNullOrEmpty(QuestName)) { base.enabled = false; } else { CoroutineRunner.Start(initialize(), this, "ObjectiveListener"); } }
private void setupPooledScrollRect(int count, bool overridePool = false) { if (overridePool) { PooledScrollRect.ElementPoolOverride = goPoolOverride.ObjectPool; } PooledScrollRect.gameObject.SetActive(value: true); PooledScrollRect.ObjectAdded += onObjectAdded; PooledScrollRect.ObjectRemoved += onObjectRemoved; PooledScrollRect.Init(count, buttonPrefab); CoroutineRunner.Start(setScrollRectPersistentPosition(), this, "Waiting for Pooled ScrollRect"); }
private void startOpenCellPhone() { if (!Service.Get <UIElementDisablerManager>().IsUIElementDisabled("CellphoneButton")) { CoroutineRunner.Start(showPhone(playTransitionAnimation: true), this, "showPhone(true)"); isCellPhoneOpenOrOpening = true; } else { isCellPhoneOpenOrOpening = false; } }
public void AddPersistentBreadcrumb(PersistentBreadcrumbTypeDefinitionKey type, string id) { Breadcrumb item = new Breadcrumb(id, type.Id); persistentBreadcrumbs.Add(item); addSyncQueue.Add(item); if (addSyncCoroutine == null || addSyncCoroutine.Disposed) { addSyncCoroutine = CoroutineRunner.Start(syncAddedBreadcumbs(), this, "Batching breadcrumb adds"); } AddBreadcrumb(PersistentBreadcrumbTypeDefinition.ToStaticBreadcrumb(type.Id, id)); }
public void OnSendChatActivity() { if (!IsChatActive) { IsChatActive = true; } else { stopCoroutine(chatActivityCancelTimer); } chatActivityCancelTimer = CoroutineRunner.Start(startChatActivityCancelTimer(5f), this, "startChatActivityTimeOut"); }
private void spawnObject(Vector3 position) { if (propService.userIdToPropUser.ContainsKey(serverObjectItemData.Item.CreatorId)) { propService.onPropUsed(serverObjectItemData.Item.CreatorId, ((ConsumableItem)serverObjectItemData.Item).Type, serverObjectItemData.Item.Id.Id.ToString(), position); } else { CoroutineRunner.Start(propService.loadWorldExperience(serverObjectItemData.Item as ConsumableItem, position), this, "loadWorldExperience"); } removeReferences(); }
private void Start() { eventDispatcher = Service.Get <EventDispatcher>(); eventChannel = new EventChannel(eventDispatcher); eventChannel.AddListener <HudEvents.HideCellPhoneHud>(onHideCellPhoneHud); eventChannel.AddListener <HudEvents.ShowCellPhoneHud>(onShowCellPhoneHud); eventChannel.AddListener <CellPhoneEvents.CellPhoneClosed>(onCellPhoneClosed); notificationHandler = GetComponent <CellPhoneNotificationHandler>(); if (Service.Get <SceneTransitionService>().HasSceneArg(SceneTransitionService.SceneArgs.ShowCellPhoneOnEnterScene.ToString())) { CoroutineRunner.Start(showPhone(playTransitionAnimation: false), this, "showPhone(false)"); } else { if (!Service.Get <GameStateController>().IsFTUEComplete || Service.Get <ZoneTransitionService>().IsInIgloo) { return; } bool flag = true; DateTime dateTime = Service.Get <ContentSchedulerService>().PresentTime(); if (shouldPreventPhoneFromOpening()) { flag = false; PlayerPrefs.SetString("DailyChallengesLastOpen", dateTime.GetTimeInMilliseconds().ToString()); } else if (PlayerPrefs.HasKey("DailyChallengesLastOpen")) { string @string = PlayerPrefs.GetString("DailyChallengesLastOpen"); if (!string.IsNullOrEmpty(@string)) { DateTime dateTime2 = Convert.ToInt64(@string).MsToDateTime(); if (dateTime.Day == dateTime2.Day) { flag = false; } } } if (flag) { autoOpened = true; if (!Service.Get <LoadingController>().IsLoading) { CoroutineRunner.Start(playRingAnimationAndShowPhone(), this, "CellPhoneRing"); } else { eventDispatcher.AddListener <LoadingController.LoadingScreenHiddenEvent>(onLoadingScreenHidden); } logOpenPhoneBi(); PlayerPrefs.SetString("DailyChallengesLastOpen", dateTime.GetTimeInMilliseconds().ToString()); } } }
public void OnClearButtonClicked() { ClearCacheButton.interactable = false; ButtonImage.SetActive(value: false); ButtonText.SetActive(value: false); Preloader.SetActive(value: true); DoneImage.SetActive(value: false); DoneText.SetActive(value: false); clearImageCache(); clearContentCache(); CoroutineRunner.Start(waitForAnimationPreloader(), this, "waitForAnimationPreloader"); }
public void OnCreateClicked() { if (createController.CheckRegConfigReady()) { Service.Get <ICPSwrveService>().Action("game.account_creation", "submit_clicked"); CoroutineRunner.StopAllForOwner(this); CoroutineRunner.Start(submitActions(), this, "CreateFormSubmitValidation"); } AccountFlowData accountFlowData = Service.Get <MembershipService>().GetAccountFlowData(); accountFlowData.FlowType = AccountFlowType.create; }
private void adjustSceneForQuest(bool isQuestActive) { bool flag = false; if (!isQuestActive && (spawnedObjects == null || spawnedObjects.Count == 0)) { if (!areAdjustmentsVisible) { spawnPrefabs(); CoroutineRunner.Start(loadAdditiveScene(), this, "loadAdditiveScene"); areAdjustmentsVisible = true; flag = true; } } else if (areAdjustmentsVisible) { foreach (GameObject spawnedObject in spawnedObjects) { if (spawnedObject != null) { spawnedObject.SetActive(!isQuestActive); } } if (isSceneLoaded) { SceneManager.UnloadSceneAsync(AdditiveScene); isSceneLoaded = false; } areAdjustmentsVisible = false; flag = true; } if (!flag) { return; } GameObject[] disableData = DisableData; foreach (GameObject current in disableData) { if (current != null) { current.SetActive(isQuestActive); } } disableData = EnableData; foreach (GameObject current in disableData) { if (current != null) { current.SetActive(!isQuestActive); } } }
private void handlePlayerTurnStart(PartyGameSessionMessages.PlayerTurnStart data) { if (currentState == FindFourState.Game) { if (data.PlayerId == localPlayerSessionId) { changeControlState(ControlsState.Enabled); board.CreateNewToken(getTokenColor(data.PlayerId), isLocalPlayer: true); CoroutineRunner.Start(dropClientTokenOnTurnTimeout(), this, "dropClientTokenOnTurnTimeout"); } hudUI.SetCurrentPlayersTurn(data.PlayerId); } }
private void loadApplet(CellPhoneEvents.ChangeCellPhoneScreen evt, PrefabContentKey prefabKey) { ConditionalConfiguration conditionalConfiguration = Service.Get <ConditionalConfiguration>(); int num = conditionalConfiguration.Get("System.Memory.property", 0); if (evt.AppletSceneSystemMemoryThreshold >= 0 && num <= evt.AppletSceneSystemMemoryThreshold) { loadAppletScene(evt, prefabKey); return; } loadScreen(prefabKey, showLoadingScreen: false); CoroutineRunner.Start(runLoadingScreenTimer(), this, "CellPhoneLoadingScreenTimer"); }
private void loadFranchise() { Content.LoadAsync(onItemPrefabLoaded, DisneyStoreItemPrefabKey); if (!string.IsNullOrEmpty(franchiseDef.FranchiseIconPath.Key)) { CoroutineRunner.Start(loadSprite(franchiseDef.FranchiseIconPath, IconImage), this, ""); } if (!string.IsNullOrEmpty(franchiseDef.FranchiseHeaderPath.Key)) { CoroutineRunner.Start(loadSprite(franchiseDef.FranchiseHeaderPath, HeaderImage), this, ""); } applyImageTints(); }
public void RenderReward(DReward reward, RewardIconRenderComplete callback) { this.callback = callback; EmoteDefinition emoteByName = getEmoteByName((string)reward.UnlockID); if (emoteByName != null) { CoroutineRunner.Start(renderEmote(emoteByName), this, ""); return; } Log.LogError(this, "Unable to find emote definition of name: " + reward.UnlockID); CoroutineRunner.Start(loadDefaultIcon(), this, ""); }
private IEnumerator setSlideLocomotion(float waitTime, GameObject penguinObj) { yield return(new WaitForSeconds(waitTime)); if (!LocomotionHelper.IsCurrentControllerOfType <SlideController>(penguinObj)) { if (!LocomotionHelper.SetCurrentController <SlideController>(penguinObj)) { Log.LogErrorFormatted(this, "Failed to set the SlideController on {0}", penguinObj.GetPath()); } CoroutineRunner.Start(toggleWaterTrigger(2f), this, "toggleWaterCollider"); } }
private void turnOnEffectsForGame() { BlueScoreBar.StartBounceAnim(); RedScoreBar.StartBounceAnim(); FloorController.SetFloorAnim(redAnimOn: true, blueAnimOn: true); StageAnimator.ResetTrigger("GameOver"); CadenceAnimator.ResetTrigger("CadenceGoodbye"); StageAnimator.ResetTrigger("WinBlue"); StageAnimator.ResetTrigger("WinRed"); StageAnimator.ResetTrigger("WinTie"); StageAnimator.SetTrigger("CadenceRises"); CoroutineRunner.Start(playCadenceRiseAnim(), this, "PlayCadenceRise"); }
public void OnKeepShoppingClicked() { switch (currentState) { case ConfirmationState.Complete: CoroutineRunner.Start(tweenIconToTray(), this, ""); break; case ConfirmationState.Pending: storeFranchise.HideConfirmation(); break; } }
private void onExperienceStarted(string instanceId, long ownerId, bool isOwnerLocalPlayer, PropDefinition propDef) { partyBlasterId = instanceId; setupNetworkServiceListeners(); if (BlastEffectPrefab != null) { CoroutineRunner.Start(playBlastEffect(), this, "playBlastEffect"); } if (EffectRadiusPrefab != null) { CoroutineRunner.Start(playEffectRadius(), this, "playEffectRadius"); } }
private void showNextScreen() { currentScreenIndex++; Service.Get <TrayNotificationManager>().DismissAllNotifications(); if (currentScreenIndex < screenData.Length) { CoroutineRunner.Start(showPopupScreen(screenData[currentScreenIndex]), this, "RewardPopupControler.showPopupScreen"); } else { closeRewardPopup(); } }
protected override IEnumerator setup() { yield return(CoroutineRunner.Start(base.setup(), this, "AccountFormTests base.setup call")); AssetRequest <GameObject> assetRequest = Content.LoadAsync(rootNodeKey); while (!assetRequest.Finished) { yield return(null); } PopupCanvas.AddComponent <PopupManager>(); popupRoot = Object.Instantiate(assetRequest.Asset); }
public override void OnStart(Dictionary <string, object> args) { CoroutineRunner.Start(Coroutine()) .Error(e => { // Catch an exception // 例外をキャッチ Print(e.GetType().Name); Print(e.Message); Print(e.StackTrace !); Print("Press [ESC] to return"); }); }
private bool onStartQuestRequest(QuestEvents.StartQuest evt) { trace("Starting quest {0}", evt.Quest.Id); if (evt.Quest.Id != Service.Get <GameStateController>().FTUEConfig.FtueQuestId) { CoroutineRunner.Start(ShowStartQuestSplashscreen(evt.Quest), this, "Load splash screen"); pendingQuest = evt.Quest; pendingQuestStart = true; } Service.Get <ICPSwrveService>().StartTimer("questtime", "quest." + evt.Quest.Definition.name); AdventureReminderTutorial.ClearReminderCount(evt.Quest.Mascot.Name); return(false); }
private bool onShowSelectedUIWidget(IglooUIEvents.ShowSelectedUIWidget evt) { if (decorationOptionsUIInstance == null) { Content.LoadAsync(onRemoveDecorationPrefabLoaded, PrefabRemoveDecorationContentKey); CoroutineRunner.Start(delayTillLoadComplete(evt.ManipulatableObject, evt.BoundsForCameraTarget, evt.MinCameraDistance), this, "Delay for Widget load"); } else { setNewDecorationDetails(evt.ManipulatableObject, evt.BoundsForCameraTarget, evt.MinCameraDistance); } return(false); }
private bool onGameRoundEnded(IslandTargetsEvents.GameRoundEnded evt) { RemoveListeners(); if (localDamageCount < DamageCapacity) { CoroutineRunner.Start(AnimateOutOfViewDelayed(2f), this, "TargetAnimateOutDelayed"); } else { CoroutineRunner.Start(AnimateOutOfView(), this, "TargetAnimateOut"); } return(false); }
private IEnumerator retrieveProp() { if (Prop.UseOnceImmediately) { onUseDestination = onUseDestination.normalized * Prop.MaxDistanceFromUser; yield return(CoroutineRunner.Start(PropUser.RetrievePropWithImmediateUseDest(Prop, onUseDestination), this, "PropUser.RetrievePropWithImmediateUseDest")); } else { yield return(CoroutineRunner.Start(PropUser.RetrieveProp(Prop), this, "PropUser.RetrieveProp")); } Prop.gameObject.SetActive(value: true); }