コード例 #1
0
        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));
        }
コード例 #2
0
 public void Show()
 {
     if (CanvasGroupFader != null)
     {
         CanvasGroupFader.FadeIn();
     }
 }
コード例 #3
0
        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();
            }
        }
コード例 #4
0
        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));
        }
コード例 #5
0
 public void OnShow()
 {
     if (Fader != null)
     {
         Fader.FadeIn();
     }
 }
コード例 #6
0
ファイル: UIPauseScreen.cs プロジェクト: bshishov/LudumDare47
        public void ChangeState()
        {
            if (_fader.State == UICanvasGroupFader.FaderState.FadedIn)
            {
                _fader.FadeOut();
            }

            if (_fader.State == UICanvasGroupFader.FaderState.FadedOut)
            {
                _fader.FadeIn();
            }
        }
コード例 #7
0
        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);
        }
コード例 #8
0
ファイル: UIDeathScreen.cs プロジェクト: bshishov/LudumDare44
 private void PlayerStateOnDeath()
 {
     _canvasGroupFader.FadeIn();
 }