private void OnUIEvent(UIEvent data) { UIEvent.Type type = data.type; if (type == UIEvent.Type.CakeRaceTimerStarted) { this.InitTimeBombAnimations(); } }
private void OnUIEvenet(UIEvent data) { UIEvent.Type type = data.type; if (type == UIEvent.Type.ClosedLootWheel) { this.Check(); } }
private void ReceiveUIEvent(UIEvent data) { UIEvent.Type type = data.type; if (type == UIEvent.Type.Play) { this.Freeze(); this.FindContraption(); } }
protected override bool HandleUIEvent(UIEvent data) { UIEvent.Type type = data.type; if (type == UIEvent.Type.ReplayLevel) { base.StopRunningContraption(); this.levelManager.SetGameState(LevelManager.GameState.Building); return(true); } if (type != UIEvent.Type.NextLevel && type != UIEvent.Type.LevelSelection) { return(false); } if (this.levelManager.gameState != LevelManager.GameState.PausedWhileRunning) { if (this.levelManager.gameState == LevelManager.GameState.PausedWhileBuilding) { if (this.levelManager.ContraptionProto.HasSuperGlue) { GameProgress.AddSuperGlue(1); } if (this.levelManager.ContraptionProto.HasSuperMagnet) { GameProgress.AddSuperMagnet(1); } if (this.levelManager.ContraptionProto.HasTurboCharge) { GameProgress.AddTurboCharge(1); } if (this.levelManager.ContraptionProto.HasNightVision) { GameProgress.AddNightVision(1); } } else if (this.levelManager.gameState == LevelManager.GameState.Completed) { } } if (GameTime.IsPaused()) { GameTime.Pause(false); } if (data.type == UIEvent.Type.NextLevel) { CakeRaceMenu.FindNewPlayer = true; } this.levelManager.SetGameState(LevelManager.GameState.Undefined); Singleton <GameManager> .Instance.LoadCakeRaceMenu(true); return(true); }
public void ReceiveUIEvent(UIEvent data) { UIEvent.Type type = data.type; if (type != UIEvent.Type.OpenIapMenu) { if (type == UIEvent.Type.CloseIapMenu) { this.m_shopIsOpen = false; } } else { this.m_shopIsOpen = true; } }
private void ReceiveUIEvent(UIEvent data) { UIEvent.Type type = data.type; if (type != UIEvent.Type.Building) { if (type != UIEvent.Type.Play) { if (type != UIEvent.Type.Pause) { if (type == UIEvent.Type.ContinueFromPause) { this.paused = false; } } else { this.paused = true; } } else { this.paused = false; if (!this.alwaysOn && this.delayedStart > 0f) { this.state = State.DelayedStart; } else { this.TurnOn(); } this.FindContraption(); } } else { this.TurnOff(); this.state = State.Inactive; this.fanSprite.transform.localRotation = Quaternion.identity; this.paused = true; } }
private void OnReceivedUIEvent(UIEvent data) { if (!Singleton <GameManager> .IsInstantiated()) { return; } if (Singleton <GameManager> .Instance.GetGameState() == GameManager.GameState.MainMenu) { ResourceBar.Instance.ShowItem(ResourceBar.Item.PlayerProgress, false, false); return; } UIEvent.Type type = data.type; if (type != UIEvent.Type.OpenedLootWheel) { if (type == UIEvent.Type.ClosedLootWheel) { if (Singleton <PlayerProgress> .Instance.LevelUpPending && ResourceBar.Instance.IsItemEnabled(ResourceBar.Item.PlayerProgress)) { this.SetState(PlayerProgressBar.State.WaitingLevelActive); } else if (Singleton <PlayerProgress> .Instance.LevelUpPending && !ResourceBar.Instance.IsItemEnabled(ResourceBar.Item.PlayerProgress)) { this.SetState(PlayerProgressBar.State.WaitingLevelInactive); } else { this.SetState(PlayerProgressBar.State.Regular); } } } else { this.SetState(PlayerProgressBar.State.Regular); this.UpdateAmount(true); } }
private void OnReceivedEvent(UIEvent data) { if (SchematicButton.LevelManager != null && !SchematicButton.LevelManager.m_sandbox) { return; } int num = -1; UIEvent.Type type = data.type; if (type != UIEvent.Type.LoadContraptionSlot1) { if (type != UIEvent.Type.LoadContraptionSlot2) { if (type == UIEvent.Type.LoadContraptionSlot3) { num = 2; } } else { num = 1; } } else { num = 0; } if (num >= 0) { GameProgress.SetInt(SchematicButton.LastLoadedSlotKey, num, GameProgress.Location.Local); for (int i = 0; i < this.selectedSlotSprites.Count; i++) { this.selectedSlotSprites[i].GetComponent <Renderer>().enabled = (num == i); } } }
public void CloseAndUseSuperMechanic(UIEvent.Type eventType) { base.gameObject.SetActive(false); EventManager.Send(new UIEvent(eventType)); }
public PulseButtonEvent(UIEvent.Type buttonEvent, bool pulse = true) { this.buttonEvent = buttonEvent; this.pulse = pulse; }
private void OnReceivedUIEvent(UIEvent data) { UIEvent.Type type = data.type; switch (type) { case UIEvent.Type.OpenedLootWheel: this.SwitchCondition(ComplexVisibilityManager.Condition.LootWheelOpen, true); break; case UIEvent.Type.ClosedLootWheel: this.SwitchCondition(ComplexVisibilityManager.Condition.LootWheelOpen, false); break; case UIEvent.Type.OpenedSnoutCoinShop: this.SwitchCondition(ComplexVisibilityManager.Condition.SnoutCoinShopOpen, true); break; case UIEvent.Type.ClosedSnoutCoinShop: this.SwitchCondition(ComplexVisibilityManager.Condition.SnoutCoinShopOpen, false); break; case UIEvent.Type.OpenedLootCrateDialog: this.SwitchCondition(ComplexVisibilityManager.Condition.LootCrateDialogOpen, true); break; case UIEvent.Type.ClosedLootCrateDialog: this.SwitchCondition(ComplexVisibilityManager.Condition.LootCrateDialogOpen, false); break; default: if (type != UIEvent.Type.OpenIapMenu) { if (type == UIEvent.Type.CloseIapMenu) { this.SwitchCondition(ComplexVisibilityManager.Condition.ShopOpen, false); } } else { this.SwitchCondition(ComplexVisibilityManager.Condition.ShopOpen, true); } break; case UIEvent.Type.OpenedMainMenuPromo: this.SwitchCondition(ComplexVisibilityManager.Condition.MainMenuPromo, true); break; case UIEvent.Type.ClosedMainMenuPromo: this.SwitchCondition(ComplexVisibilityManager.Condition.MainMenuPromo, false); break; case UIEvent.Type.OpenedPurchaseConfirmation: this.SwitchCondition(ComplexVisibilityManager.Condition.PurchaseProductConfirmation, true); break; case UIEvent.Type.ClosedPurchaseConfirmation: this.SwitchCondition(ComplexVisibilityManager.Condition.PurchaseProductConfirmation, false); break; case UIEvent.Type.OpenedNotificationPopup: this.SwitchCondition(ComplexVisibilityManager.Condition.NotificationPopupOpen, true); break; case UIEvent.Type.ClosedNotificationPopup: this.SwitchCondition(ComplexVisibilityManager.Condition.NotificationPopupOpen, false); break; case UIEvent.Type.ShopLockedScreen: this.SwitchCondition(ComplexVisibilityManager.Condition.ShopLockedScreen, true); break; case UIEvent.Type.ShopUnlockedScreen: this.SwitchCondition(ComplexVisibilityManager.Condition.ShopLockedScreen, false); break; case UIEvent.Type.OpenedCakeRaceUnlockedPopup: this.SwitchCondition(ComplexVisibilityManager.Condition.CakeRaceUnlockDialogOpen, true); break; case UIEvent.Type.ClosedCakeRaceUnlockedPopup: this.SwitchCondition(ComplexVisibilityManager.Condition.CakeRaceUnlockDialogOpen, false); break; case UIEvent.Type.OpenedDailyChallengeDialog: this.SwitchCondition(ComplexVisibilityManager.Condition.DailyChallengeDialogOpen, true); break; case UIEvent.Type.ClosedDailyChallengeDialog: this.SwitchCondition(ComplexVisibilityManager.Condition.DailyChallengeDialogOpen, false); break; case UIEvent.Type.OpenedWorkshopIntroduction: this.SwitchCondition(ComplexVisibilityManager.Condition.WorkshopIntroductionOpen, true); break; case UIEvent.Type.ClosedWorkshopIntroduction: this.SwitchCondition(ComplexVisibilityManager.Condition.WorkshopIntroductionOpen, false); break; case UIEvent.Type.OpenedPurchaseRoadHogsParts: this.SwitchCondition(ComplexVisibilityManager.Condition.PurchaseRoadHogsPartsOpen, true); break; case UIEvent.Type.ClosedPurchaseRoadHogsParts: this.SwitchCondition(ComplexVisibilityManager.Condition.PurchaseRoadHogsPartsOpen, false); break; } }