private IEnumerator OpenPauseMenu() { Image fadeTexture = GameInstance.GetInstance().UI_Components.fadeTexture; Color newColor = new Color(fadeTexture.color.r, fadeTexture.color.g, fadeTexture.color.b, maximumAlpha); float counter = 0f; Time.timeScale = 0; //We need to set all character controller inputs to zero SwitchControl.ControlledCharacter.characterMotor.NullifyMovement(); //We need to set the new state at the beginning of the coroutine InputManager.state = InputState.PauseMenu; //Standard black fade in while (counter < 1f) { counter += Time.fixedDeltaTime; fadeTexture.color = Color.Lerp(fadeTexture.color, newColor, counter); menuGroup.alpha = Mathf.Lerp(menuGroup.alpha, 1, counter); yield return(null); } menuGroup.Activate(); }
private void ShowPanel(bool show, bool tween = true) { scrollerGroup.Activate(!show); if (!show) { tempPage = scroller.CurrentPage; } float scale = show ? 1 : 0; int sfxId = show ? 0 : 1; if (tween) { //AudioManager.Instance.PlaySFX("Bubble", sfxId); Tweener tweener = transform.DOScale(scale, 0.15f); tweener.OnComplete(RefreshScroller); } else { transform.localScale = new Vector3(scale, scale, scale); scrollerGroup.Activate(true); } }
public void Show(bool combat = false) { if (_eventTypeDataEntriesLeft == null) { _eventTypeDataEntriesLeft = new List <EventTypeData>(_eventTypeDatas); } _priorityWithCrownGo.SetActive(!combat); _uiRoot.Activate(); _hasShownHighlights = false; Game.Instance.ResetPlayerDataEntries(); Game.Instance.GetPlayerData(_playerPriorityIndex).HasPriority = !combat; KillAllCards(); List <CardData> cardsFromEvent = GetCards(combat); SpawnCards(cardsFromEvent); }