public override IEnumerator PerformFirstPass() { RecentDecorationsService recentDecorationsService = new RecentDecorationsService(); recentDecorationsService.MaxCountRecentDecorations = MaxCountRecentDecorations; Service.Set(recentDecorationsService); yield break; }
public void OnUseItClicked() { if (currentState == ConfirmationState.Complete) { RecentDecorationsService recentDecorationsService = Service.Get <RecentDecorationsService>(); recentDecorationsService.ShouldShowMostRecentPurchase = true; recentDecorationsService.SetRecentPurchaseData(item.ItemType, item.ID); if (Service.Get <ZoneTransitionService>().IsInIgloo) { catalog.OnCloseClicked(); return; } Service.Get <ActionConfirmationService>().ConfirmAction(typeof(IglooCatalogPurchaseConfirmation), null, sendPlayerToIgloo); Object.Destroy(base.gameObject); } }
private void onDecorationsLoaded(DecorationType decorationType) { switch (decorationType) { case DecorationType.Decoration: isDecorationInventoryLoaded = true; break; case DecorationType.Structure: isStructureInventoryLoaded = true; break; } if (!isDecorationInventoryLoaded || !isStructureInventoryLoaded) { return; } RecentDecorationsService recentDecorationsService = Service.Get <RecentDecorationsService>(); if (recentDecorationsService.ShouldShowMostRecentPurchase) { string target = "IglooScreenContainerContent"; string targetEvent = "igloonone"; bool flag = false; if (recentDecorationsService.MostRecentPurchaseType == DecorationType.Decoration) { targetEvent = "igloofurnitureevent"; flag = true; } else if (recentDecorationsService.MostRecentPurchaseType == DecorationType.Structure) { targetEvent = "igloostructuresevent"; flag = true; } if (flag) { stateController.SendContextEvent(target, targetEvent); } } }
protected override void Start() { base.Start(); if (SceneRefs.IsSet <SceneManipulationService>()) { sceneManipulationService = SceneRefs.Get <SceneManipulationService>(); sceneManipulationService.ObjectRemoved += onObjectAddedOrRemoved; sceneManipulationService.ObjectAdded += onObjectAddedOrRemoved; sceneManipulationService.NewObjectCreated += onObjectAddedOrRemoved; } if (SceneRefs.IsSet <ObjectManipulationInputController>()) { objectManipulationInputController = SceneRefs.Get <ObjectManipulationInputController>(); objectManipulationInputController.InteractionStateChanged += onInteractionStateChanged; } recentDecorationsService = Service.Get <RecentDecorationsService>(); decorationInventoryService = Service.Get <DecorationInventoryService>(); decorationCategoryManager = GetComponentInChildren <DecorationCategoryManager>(); if (decorationCategoryManager != null) { DecorationCategoryManager obj = decorationCategoryManager; obj.CategoryRefreshedEvent = (CategoryRefreshedEvent)Delegate.Combine(obj.CategoryRefreshedEvent, new CategoryRefreshedEvent(onCategoryUpdated)); } totalDragHeight = (base.transform as RectTransform).rect.height; GameObject gameObject = GameObject.Find("IglooMenuLoader"); if (gameObject != null) { totalDragHeight += (gameObject.transform as RectTransform).rect.height; } Canvas componentInParent = GetComponentInParent <Canvas>(); if (componentInParent != null) { Assert.AreEqual(componentInParent.transform.localScale.x, componentInParent.transform.localScale.y); totalDragHeight *= componentInParent.transform.localScale.x; } returnToPreviousState = GetComponentInParent <ReturnToFSMStateOnInteractionState>(); }