public void ShowItemInfo(Item item, float duration = 2f) { SetIcon(item.Icon); Caption.text = item.Name; Text.text = item.Description; _fader.FadeIn(); if (_showRoutine != null) { StopCoroutine(_showRoutine); } _showRoutine = StartCoroutine(HideAfter(duration)); }
public void Show() { if (CanvasGroupFader != null) { CanvasGroupFader.FadeIn(); } }
private void OnInteractableChanged(IInteractable oldInteractable, IInteractable newInteractable) { foreach (Transform child in LineContainer) { GameObject.Destroy(child.gameObject); } if (newInteractable != null) { if (newInteractable.Type == InteractableType.DroppedSpell) { AddLine($"<<color=red>E</color>> {newInteractable.GetInteractionText(Interaction.Pick)}"); AddLine($"<<color=red>Q</color>> {newInteractable.GetInteractionText(Interaction.Dismantle)}"); } if (newInteractable.Type == InteractableType.DroppedItem) { AddLine($"<<color=red>E</color>> {newInteractable.GetInteractionText(Interaction.Pick)}"); } if (newInteractable.Type == InteractableType.Shop) { AddLine($"<<color=red>E</color>> {newInteractable.GetInteractionText(Interaction.Buy)}"); } _fader.FadeIn(); } else { _fader.FadeOut(); } }
public void Show(InvalidAction invalidAction) { switch (invalidAction) { case InvalidAction.InvalidTarget: Text.text = "Invalid Target"; break; case InvalidAction.NotEnoughBlood: Text.text = "Not enough blood"; break; case InvalidAction.CantCastSpell: Text.text = "Can't cast"; break; case InvalidAction.SpellIsNotReady: Text.text = "Not ready"; break; } _fader.FadeIn(); if (_showRoutine != null) { StopCoroutine(_showRoutine); } _showRoutine = StartCoroutine(HideAfter(ShowDuration)); }
public void OnShow() { if (Fader != null) { Fader.FadeIn(); } }
public void ChangeState() { if (_fader.State == UICanvasGroupFader.FaderState.FadedIn) { _fader.FadeOut(); } if (_fader.State == UICanvasGroupFader.FaderState.FadedOut) { _fader.FadeIn(); } }
public GameObject ShowPopup(GameObject prefab) { if (prefab == null) { Debug.LogWarning("Prefab is not set"); return(null); } HidePopup(); var go = Instantiate(prefab, PopupParent); var popup = go.GetComponent <IPopup>(); popup?.OnShow(); _activePopup = go; PopupPanel.FadeIn(); SoundManager.Instance.Play(SoundBank.Instance.PopupOpen); return(go); }
private void PlayerStateOnDeath() { _canvasGroupFader.FadeIn(); }