public void CollectReward(bool hideProgressBar = true) { EventManager.Disconnect(new EventManager.OnEvent <LevelUpEvent>(this.OnPlayerLevelUp)); if (this.collectRewardButton != null) { this.collectRewardButton.SetActive(false); } if (this.rewardGameObject != null) { UnityEngine.Object.Destroy(this.rewardGameObject); } this.machineIsLocked = false; BackgroundMask.Show(false, this, "Popup", null, Vector3.back, true); if (hideProgressBar) { ResourceBar.Instance.ShowItem(ResourceBar.Item.PlayerProgress, false, true); } ResourceBar.Instance.ShowItem(ResourceBar.Item.SnoutCoin, true, true); this.SetMachineAnimation(this.hideRewardAnimationName, false, false, true); this.partListingButton.UpdateNewTagState(); if (!this.IsAlienMachine) { this.customizationsFullCheck.Check(); } else { this.UpdateAlienPartSilhouette(); } this.alienConverter.Check(); }
private void OnEnable() { if (this.scrollPivot == null) { this.CreateGUI(); } BackgroundMask.Show(true, this, this.sortingLayer, base.transform, new Vector3(0f, 0f, 0.1f), false); Singleton <KeyListener> .Instance.GrabFocus(this); KeyListener.keyReleased += this.HandleKeyReleased; }
public void ShowRewarding(bool showHorns, int rewardAmount, GameObject target, BackgroundType bgType, Action OnEnd) { base.gameObject.SetActive(true); this.ShowHorns(showHorns); BackgroundMask.Show(true, this, "Popup", base.transform, Vector3.forward * 0.1f, false); this.icon = this.ConstructIcon(target, bgType, rewardAmount); this.icon.transform.parent = this.targetPosition; this.icon.transform.localPosition = Vector3.zero; this.icon.transform.localRotation = Quaternion.identity; this.icon.transform.localScale = Vector3.one; this.OnClosed = OnEnd; this.ShowAnimation(); }
public void OnPressed() { if (!base.gameObject.activeSelf) { return; } base.gameObject.SetActive(false); BackgroundMask.Show(false, this, string.Empty, null, default(Vector3), false); if (this.OnClosed != null) { this.OnClosed(); } }
private void OnDisable() { if (BackgroundMask.Instantiated) { BackgroundMask.Show(false, this, string.Empty, null, default(Vector3), false); } if (Singleton <KeyListener> .IsInstantiated()) { Singleton <KeyListener> .Instance.ReleaseFocus(this); KeyListener.keyReleased -= this.HandleKeyReleased; } }
private void OnDisable() { BackgroundMask.Show(false, this, string.Empty, null, default(Vector3), false); EventManager.Send(new UIEvent(UIEvent.Type.ClosedWorkshopIntroduction)); }
private void OnEnable() { BackgroundMask.Show(true, this, "Popup", base.transform, Vector3.forward, false); EventManager.Send(new UIEvent(UIEvent.Type.OpenedWorkshopIntroduction)); }
private IEnumerator WaitForReward(GameObject reward, int exp) { Transform[] tfs = reward.GetComponentsInChildren <Transform>(); foreach (Transform transform in tfs) { transform.gameObject.layer = LayerMask.NameToLayer("Default"); } MeshRenderer[] mrs = reward.GetComponentsInChildren <MeshRenderer>(); foreach (MeshRenderer meshRenderer in mrs) { meshRenderer.sortingLayerName = "Default"; meshRenderer.sortingOrder = 0; } reward.SetActive(false); float waitTime = 1f; while (waitTime > 0f) { waitTime -= Time.deltaTime; yield return(null); } reward.SetActive(true); waitTime = 6.18f; while (waitTime > 0f) { waitTime -= Time.deltaTime; yield return(null); } if (this.IsAlienMachine) { Singleton <AudioManager> .Instance.Spawn2dOneShotEffect(this.gameData.commonAudioCollection.alienMachineReveal); } foreach (MeshRenderer meshRenderer2 in mrs) { meshRenderer2.sortingLayerName = "Popup"; meshRenderer2.sortingOrder = 0; } reward.transform.ResetPosition(TransformCategory.Axis.Z); BackgroundMask.Show(true, this, "Popup", null, Vector3.forward, true); ResourceBar.Instance.ShowItem(ResourceBar.Item.PlayerProgress, true, false); foreach (Transform transform2 in tfs) { transform2.gameObject.layer = LayerMask.NameToLayer("HUD"); } yield return(new WaitForSeconds(2f)); if (PlayerProgressBar.Instance) { PlayerProgressBar.Instance.AddParticles(reward, exp, 0f, 0f, delegate(bool active) { if (active) { ResourceBar.Instance.ShowItem(ResourceBar.Item.PlayerProgress, true, true); } }); } if (this.collectRewardButton != null) { this.collectRewardButton.SetActive(true); } EventManager.Connect(new EventManager.OnEvent <LevelUpEvent>(this.OnPlayerLevelUp)); yield break; }
private void OnDisable() { BackgroundMask.Show(false, this, string.Empty, null, default(Vector3), false); }
private void OnEnable() { BackgroundMask.Show(true, this, this.sortingLayerName, base.transform, Vector3.zero, false); }