Exemplo n.º 1
0
 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);
 }
        internal GameProfiles(GameProfilesApi api, User user, AsyncTaskDispatcher taskDispatcher,
                              CoroutineRunner coroutineRunner)
        {
            Assert.IsNotNull(api, "Can not construct GameProfile manager; api is null!");
            Assert.IsNotNull(user, "Can not construct GameProfile manager; userAccount is null!");
            Assert.IsNotNull(taskDispatcher, "Can not construct GameProfile manager; taskDispatcher is null!");
            Assert.IsNotNull(coroutineRunner, "Can not construct GameProfile manager; coroutineRunner is null!");

            this.api             = api;
            this.user            = user;
            this.taskDispatcher  = taskDispatcher;
            this.coroutineRunner = coroutineRunner;
        }
Exemplo n.º 3
0
 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");
     });
 }
Exemplo n.º 4
0
        private static void StopGlobalCustomMessageQueue(bool clearQueue = false)
        {
            if (_globalCustomMessageQueueRoutine != null)
            {
                CoroutineRunner.StopCoroutine(_globalCustomMessageQueueRoutine);
                _globalCustomMessageQueueRoutine = null;
            }

            if (clearQueue)
            {
                _globalCustomMessageQueue.Clear();
            }
        }
        internal Categories(CategoriesApi api, User user, AsyncTaskDispatcher taskDispatcher,
                            CoroutineRunner coroutineRunner)
        {
            Assert.IsNotNull(api, "Can't construct Catalog manager; CatalogService parameter is null!");
            Assert.IsNotNull(user, "Can't construct Catalog manager; UserAccount parameter isnull!");
            Assert.IsNotNull(taskDispatcher, "taskReactor must not be null");
            Assert.IsNotNull(coroutineRunner, "coroutineRunner must not be null");

            this.api             = api;
            this.user            = user;
            this.taskDispatcher  = taskDispatcher;
            this.coroutineRunner = coroutineRunner;
        }
        public void OnKeepShoppingClicked()
        {
            switch (currentState)
            {
            case ConfirmationState.Complete:
                CoroutineRunner.Start(tweenIconToTray(), this, "");
                break;

            case ConfirmationState.Pending:
                storeFranchise.HideConfirmation();
                break;
            }
        }
    public void OnDestroy()
    {
        CoroutineRunner.StopAllForOwner(this);
        BaseCamera obj = baseCamera;

        obj.Moved = (System.Action)Delegate.Remove(obj.Moved, new System.Action(OnCameraMoved));
        removeDecorationListeners();
        Service.Get <EventDispatcher>().RemoveListener <InputEvents.ZoomEvent>(onInputZoom);
        if (sceneManipulationService != null && sceneManipulationService.ObjectManipulationInputController != null)
        {
            sceneManipulationService.ObjectManipulationInputController.InteractionStateChanged -= OnObjectManipulationInputControllerInteractionStateChanged;
        }
    }
Exemplo n.º 8
0
 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);
 }
        protected virtual void OnDestroy()
        {
            catalogEventChannel.RemoveAllListeners();
            Service.Get <EventDispatcher>().RemoveListener <CatalogServiceEvents.ItemPurchaseCompleteEvent>(onPurchaseComplete);
            Service.Get <EventDispatcher>().RemoveListener <CatalogServiceEvents.ItemPurchaseErrorEvent>(onPurchaseError);
            VerticalScrollingLayoutElementPool scroller = Scroller;

            scroller.OnElementShown = (Action <int, GameObject>)Delegate.Remove(scroller.OnElementShown, new Action <int, GameObject>(onElementShown));
            VerticalScrollingLayoutElementPool scroller2 = Scroller;

            scroller2.OnElementHidden = (Action <int, GameObject>)Delegate.Remove(scroller2.OnElementHidden, new Action <int, GameObject>(onElementHidden));
            CoroutineRunner.StopAllForOwner(this);
        }
Exemplo n.º 10
0
 private void Start()
 {
     dispatcher            = Service.Get <EventDispatcher>();
     scheduledEventService = Service.Get <INetworkServicesManager>().ScheduledEventService;
     dispatcher.AddListener <ScheduledEventServiceEvents.CFCDonationPosted>(onDonationPosted);
     dispatcher.AddListener <ScheduledEventServiceEvents.CFCDonationsLoaded>(onDonationLoaded);
     updateTimer = new Timer(UpdateIntervalInSeconds, repeat: true, delegate
     {
         onTimerTick();
     });
     CoroutineRunner.Start(updateTimer.Start(), this, "CFCCounterUpdate");
     scheduledEventService.GetCFCDonations();
 }
Exemplo n.º 11
0
 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);
     }
 }
Exemplo n.º 12
0
 private void showNextScreen()
 {
     currentScreenIndex++;
     Service.Get <TrayNotificationManager>().DismissAllNotifications();
     if (currentScreenIndex < screenData.Length)
     {
         CoroutineRunner.Start(showPopupScreen(screenData[currentScreenIndex]), this, "RewardPopupControler.showPopupScreen");
     }
     else
     {
         closeRewardPopup();
     }
 }
Exemplo n.º 13
0
 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");
     }
 }
Exemplo n.º 14
0
 private void OnDestroy()
 {
     CoroutineRunner.StopAllForOwner(this);
     if (controlsScreenData != null)
     {
         controlsScreenData.OnSetLeftOption              -= onSetLeftOption;
         controlsScreenData.OnReturnToDefaultLeftOption  -= onReturnToDefaultLeftOption;
         controlsScreenData.OnSetRightOption             -= onSetRightOption;
         controlsScreenData.OnReturnToDefaultRightOption -= onReturnToDefaultLeftOption;
         controlsScreenData.OnSetButton           -= onSetButton;
         controlsScreenData.IsControlsScreenActive = false;
     }
 }
 public void OnDestroy()
 {
     if (sceneLayoutListener != null)
     {
         sceneLayoutListener.StopListening();
     }
     if (layout != null)
     {
         layout.LightingIdUpdated -= onLightingIdUpdated;
     }
     eventDispatcher.RemoveListener <SceneTransitionEvents.SceneSwapLoadStarted>(onSceneSwapLoadStarted);
     CoroutineRunner.StopAllForOwner(this);
 }
Exemplo n.º 16
0
 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();
 }
Exemplo n.º 17
0
        private void onInputButtonSetLoaded(string path, InputButtonGroupDefinition groupDefinition)
        {
            bool flag = false;

            if (RightContainer != null && doesGroupDefinitionMatchDataModel(groupDefinition))
            {
                if (shouldUseButtonOverrides(groupDefinition))
                {
                    for (int i = 0; i < groupDefinition.InputButtonDefinitions.Length; i++)
                    {
                        bool flag2 = false;
                        InputButtonDefinition currentButtonDefinition = GetCurrentButtonDefinition(i);
                        if (currentButtonDefinition != groupDefinition.InputButtonDefinitions[i])
                        {
                            setUpButton(groupDefinition.InputButtonDefinitions[i], i);
                            flag2 = true;
                        }
                        if (groupDefinition.ButtonStateOverrides != null && groupDefinition.ButtonStateOverrides.Length > i && groupDefinition.ButtonStateOverrides[i] != TrayInputButton.ButtonState.None)
                        {
                            if (flag2)
                            {
                                pendingButtonStateOverrides[i] = groupDefinition.ButtonStateOverrides[i];
                            }
                            else
                            {
                                trayInputButtonGroup.Buttons[i].SetState(groupDefinition.ButtonStateOverrides[i]);
                            }
                            flag2 = true;
                        }
                        if (!flag2 && currentButtonDefinition != null)
                        {
                            setButtonToDefault(i);
                        }
                        restartButtonComponents(trayInputButtonGroup.Buttons[i]);
                    }
                }
                else
                {
                    flag = true;
                    if (replaceButtonsCoroutine != null && !replaceButtonsCoroutine.Disposed)
                    {
                        replaceButtonsCoroutine.Stop();
                    }
                    replaceButtonsCoroutine = CoroutineRunner.Start(replaceButtons(groupDefinition), this, "");
                }
            }
            if (!flag)
            {
                Service.Get <EventDispatcher>().DispatchEvent(default(ControlsScreenEvents.ControlLayoutLoadComplete));
            }
        }
Exemplo n.º 18
0
 private bool onLocalPlayerDataReady(NetworkControllerEvents.LocalPlayerDataReadyEvent evt)
 {
     if (offlineDatabase.Read <CustomEquipmentCollection>().Equipment.Count == 0)
     {
         INetworkServicesManager network = Service.Get <INetworkServicesManager>();
         network.InventoryService.GetEquipmentInventory();
         network.IglooService.GetDecorations();
         dataEntityCollection.When(dataEntityCollection.LocalPlayerHandle, delegate(SavedIgloosMetaData savedIgloosMetaData)
         {
             CoroutineRunner.StartPersistent(loadIglooEntity(network, savedIgloosMetaData), this, "loadIglooEntity");
         });
     }
     return(false);
 }
Exemplo n.º 19
0
 public void OnDestroy()
 {
     CoroutineRunner.StopAllForOwner(this);
     Service.Get <EventDispatcher>().RemoveListener <RewardServiceEvents.RewardsEarned>(onRewardsReceived);
     if (serverObjectItemData != null)
     {
         serverObjectItemData.ItemChanged -= onItemChanged;
     }
     if (!serverObjectHandle.IsNull)
     {
         dataEntityCollection.EventDispatcher.RemoveListener <DataEntityEvents.EntityRemovedEvent>(onItemRemoved);
     }
     ClearDataModelInstance();
 }
Exemplo n.º 20
0
    private void OnAnimationEnd(Spine.AnimationState state, int trackIndex)
    {
        if (this.icon != null)
        {
            this.rewardParticleSystem.transform.position = this.icon.transform.position;
            this.rewardParticleSystem.Play();
            Singleton <AudioManager> .Instance.Spawn2dOneShotEffect(WPFMonoBehaviour.gameData.commonAudioCollection.bonusBoxCollected);

            base.StartCoroutine(CoroutineRunner.DelayActionSequence(delegate
            {
                this.OnPressed();
            }, this.rewardParticleSystem.startLifetime + this.rewardParticleSystem.duration, false));
        }
    }
Exemplo n.º 21
0
        public void Setup()
        {
            Scene scene = EditorSceneManager.OpenScene("Assets/TestAssets/EditModeTestScene.unity");

            GameObject[] gameObjects = scene.GetRootGameObjects();
            mHlodGameObject = gameObjects[0].transform.Find("HLOD").gameObject;
            hlod            = mHlodGameObject.GetComponent <HLOD>() as HLOD;
            var coroutine = CoroutineRunner.RunCoroutine(HLODCreator.Create(hlod));

            while (coroutine.MoveNext())
            {
                //Wait until coroutine is finished
            }
        }
        public void UpdateTickSource()
        {
            m_RuntimeUpdateDisposable?.Dispose();
            EditorUpdateInvokerBridge.Update -= Tick;

            if (Application.isPlaying)
            {
                m_RuntimeUpdateDisposable = CoroutineRunner.Run(UpdateCoroutine());
            }
            else
            {
                EditorUpdateInvokerBridge.Update += Tick;
            }
        }
    private IEnumerator handleContentImage()
    {
        if (!string.IsNullOrEmpty(speechData.ContentImageKey))
        {
            BubbleContentImage.gameObject.SetActive(value: true);
            yield return(CoroutineRunner.Start(loadImage(speechData.ContentImageKey, BubbleContentImage), this, "CinematicSpeechBubble.loadImage"));

            BubbleContentImage.color = Color.white;
        }
        else
        {
            BubbleContentImage.gameObject.SetActive(value: false);
        }
    }
Exemplo n.º 24
0
 private void Awake()
 {
     if (base.gameObject.CompareTag("Player") && SurfaceSamplingData != null)
     {
         anim       = GetComponent <Animator>();
         tracker    = GetComponent <LocomotionTracker>();
         locoStatus = LocomotionStatus.Unknown;
         CoroutineRunner.Start(SampleSurface(), this, "SampleSurface");
     }
     else
     {
         base.enabled = false;
     }
 }
    public void Start()
    {
        layoutElementTweener = GetComponent <LayoutElementHeightTweener>();
        DEFAULT_HEIGHT      *= GetComponentInParent <CanvasScalerExt>().ScaleModifier;
        containerBG          = GetComponentInChildren <ScreenContainerBG>(includeInactive: true).gameObject;
        RectTransform content = base.transform.GetChild(0) as RectTransform;

        layoutElementTweener.Content = content;
        canvasRectTransform          = GetComponentInParent <Canvas>().GetComponent <RectTransform>();
        CoroutineRunner.Start(waitForLayout(), this, "waitForLayout");
        layoutElementTweener.OnComplete += onLayoutTweenerComplete;
        IsKeyboardShown = false;
        isOpen          = false;
    }
        internal ServerOauthLoginSession(string baseUrl, string clientId, string clientSecret, IHttpClient httpClient, CoroutineRunner coroutineRunner)
        {
            Assert.IsNotNull(baseUrl, "Creating " + GetType().Name + " failed. Parameter baseUrl is null");
            Assert.IsNotNull(clientId, "Creating " + GetType().Name + " failed. ClientId parameter is null!");
            Assert.IsNotNull(clientSecret, "Creating " + GetType().Name + " failed. ClientSecret parameter is null!");
            Assert.IsNotNull(httpClient, "Creating " + GetType().Name + " failed. Parameter httpWorker is null");
            Assert.IsNotNull(coroutineRunner, "Creating " + GetType().Name + " failed. Parameter httpWorker is null");

            this.baseUrl         = baseUrl;
            this.clientId        = clientId;
            this.clientSecret    = clientSecret;
            this.httpClient      = httpClient;
            this.coroutineRunner = coroutineRunner;
        }
Exemplo n.º 27
0
 protected void performLogin(DLoginPayload loginPayload)
 {
     if (!isLoggingIn)
     {
         loginController.OnLoginError += onLoginError;
         this.loginPayload             = loginPayload;
         toggleInteraction(isInteractable: false);
         showGeneralError(string.Empty);
         CoroutineRunner.StopAllForOwner(this);
         CoroutineRunner.Start(submitActions(loginPayload), this, "LoginFormSubmitValidation");
         AccountFlowData accountFlowData = Service.Get <MembershipService>().GetAccountFlowData();
         accountFlowData.FlowType = AccountFlowType.login;
     }
 }
        private void OnDestroy()
        {
            dispatcher.RemoveListener <RewardServiceEvents.ClaimDailySpinRewardSuccess>(onClaimSuccess);
            dispatcher.RemoveListener <RewardServiceEvents.ClaimDailySpinRewardFailed>(onClaimFail);
            Service.Get <EventDispatcher>().DispatchEvent(new UIDisablerEvents.EnableUIElement("DailySpinButton"));
            DailySpinWheel dailySpinWheel = DailySpinWheel;

            dailySpinWheel.OnSpinComplete = (System.Action)Delegate.Remove(dailySpinWheel.OnSpinComplete, new System.Action(onSpinComplete));
            DailySpinRewardScreen rewardScreen = RewardScreen;

            rewardScreen.RewardScreenComplete = (System.Action)Delegate.Remove(rewardScreen.RewardScreenComplete, new System.Action(OnRewardScreenComplete));
            CoroutineRunner.StopAllForOwner(this);
            ClubPenguin.Core.SceneRefs.Remove(this);
        }
Exemplo n.º 29
0
 protected virtual void destroy()
 {
     foreach (KeyValuePair <CallbackToken, List <RequestImageCallback> > completionCallback in completionCallbacks)
     {
         List <RequestImageCallback> value = completionCallback.Value;
         for (int i = 0; i < value.Count; i++)
         {
             value[i](success : false, null, completionCallback.Key);
         }
     }
     completionCallbacks.Clear();
     CoroutineRunner.StopAllForOwner(this);
     imageCache.ClearSessionCachedImages();
 }
 private bool onRoundEnded(IslandTargetsEvents.GameRoundEnded evt)
 {
     if (gameState == TargetsGameState.FinalRound)
     {
         gameState = TargetsGameState.Idle;
         ClockTowerAnimator.speed = 1f;
         gameState = TargetsGameState.Idle;
         dispatcher.RemoveListener <IslandTargetsEvents.TargetHit>(onTargetHit);
         CoroutineRunner.Start(setClockTimerVisible(isVisible: false, RewardDelay), this, "setClockTimerVisible");
         ClockSmallHand.transform.localRotation = Quaternion.identity;
         if (animatorFloatingClock != null && !string.IsNullOrEmpty(ClockTriggerFlyBack))
         {
             animatorFloatingClock.SetTrigger(ClockTriggerFlyBack);
             animatorFloatingClock.ResetTrigger(ClockTriggerFlyOut);
         }
         CoroutineRunner.Start(setScarecrowVisible(isVisible: true, RewardDelay), this, "setScarecrowVisible");
         FinishCamera.SetActive(value: true);
         if (ClockController != null)
         {
             ClockController.StartClock();
         }
         for (int i = 0; i < SideScoreboards.Length; i++)
         {
             SideScoreboards[i].SetState(IslandTargetsSideScoreboard.SideScoreboardState.WonGame);
         }
         CoroutineRunner.Start(resetScoreboardState(RoundWinResetDelay), this, "ResetScoreboardState");
         CoroutineRunner.Start(showRewards(), this, "ShowTargetGameRewards");
         if (!string.IsNullOrEmpty(WinMusicName))
         {
             EventManager.Instance.PostEvent(MusicEventName, EventAction.SetSwitch, WinMusicName, createCoMusicTarget);
         }
         EventManager.Instance.PostEvent(WinSFXTrigger, EventAction.PlaySound, base.gameObject);
         LogBIDataForWin();
         CoroutineRunner.Start(SwitchBackToDefautMusic(ReturnToEvergreenMusicWait), this, "SwitchToEvergreenMusic");
     }
     else
     {
         for (int i = 0; i < SideScoreboards.Length; i++)
         {
             SideScoreboards[i].SetState(IslandTargetsSideScoreboard.SideScoreboardState.BetweenRounds);
         }
     }
     if (isPlayingLowTimeSFX)
     {
         EventManager.Instance.PostEvent(LowTimeSFXTrigger, EventAction.StopSound, base.gameObject);
         isPlayingLowTimeSFX = false;
     }
     InvokeRepeating("displayGameStartCountdown", 0f, 1f);
     return(false);
 }
Exemplo n.º 31
0
 private CoroutineManager( )
 {
     GameObject go = new GameObject();
     go.name = "CoroutineManager";
     m_coroutineRunner = go.AddComponent<CoroutineRunner>();
     GameObject.DontDestroyOnLoad(go);
 }
Exemplo n.º 32
0
 // Use this for initialization
 void Start()
 {
     Instance = this;
 }
Exemplo n.º 33
0
	public CoverManager() 
	{
		all = new List<CoverBase>();

		coroutineRunner = Dependency.Get<CoroutineRunner>();
	}