From 778629883c77a458a3332061190fa1e1be4394e8 Mon Sep 17 00:00:00 2001 From: NTG Date: Fri, 29 Aug 2025 19:02:35 +0900 Subject: [PATCH] =?UTF-8?q?=EB=A7=90=ED=92=8D=EC=84=A0=20=EB=A1=9C?= =?UTF-8?q?=EC=A7=81=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/_DDD/_Scripts/Game/GameObject.meta | 3 ++ .../_Scripts/Game/GameUi/BaseUi/WorldUis.meta | 3 ++ .../GameUi/BaseUi/WorldUis/SpeechBubble.cs | 45 +++++++++++++++++++ .../BaseUi/WorldUis/SpeechBubble.cs.meta | 3 ++ 4 files changed, 54 insertions(+) create mode 100644 Assets/_DDD/_Scripts/Game/GameObject.meta create mode 100644 Assets/_DDD/_Scripts/Game/GameUi/BaseUi/WorldUis.meta create mode 100644 Assets/_DDD/_Scripts/Game/GameUi/BaseUi/WorldUis/SpeechBubble.cs create mode 100644 Assets/_DDD/_Scripts/Game/GameUi/BaseUi/WorldUis/SpeechBubble.cs.meta diff --git a/Assets/_DDD/_Scripts/Game/GameObject.meta b/Assets/_DDD/_Scripts/Game/GameObject.meta new file mode 100644 index 000000000..bb09b99f9 --- /dev/null +++ b/Assets/_DDD/_Scripts/Game/GameObject.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: e9bb6d801f134399b78da0f0cc842713 +timeCreated: 1756456534 \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/Game/GameUi/BaseUi/WorldUis.meta b/Assets/_DDD/_Scripts/Game/GameUi/BaseUi/WorldUis.meta new file mode 100644 index 000000000..8564700a8 --- /dev/null +++ b/Assets/_DDD/_Scripts/Game/GameUi/BaseUi/WorldUis.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 2abcf465835f4bc6ac505c1df0988753 +timeCreated: 1756460193 \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/Game/GameUi/BaseUi/WorldUis/SpeechBubble.cs b/Assets/_DDD/_Scripts/Game/GameUi/BaseUi/WorldUis/SpeechBubble.cs new file mode 100644 index 000000000..b97bbc31d --- /dev/null +++ b/Assets/_DDD/_Scripts/Game/GameUi/BaseUi/WorldUis/SpeechBubble.cs @@ -0,0 +1,45 @@ +using UnityEngine; +using UnityEngine.UI; + +namespace DDD +{ + public interface ISpeechBubble + { + void Show(Sprite sprite); + void Show(string key); + void Hide(); + } + + public class SpeechBubble : MonoBehaviour, ISpeechBubble + { + [SerializeField] private GameObject _panel; + [SerializeField] private Image _itemImage; + + private void Start() + { + HidePanel(); + } + + private void ShowPanel() => _panel.SetActive(true); + private void HidePanel() => _panel.SetActive(false); + public void SetImage(Sprite sprite) => _itemImage.sprite = sprite; + public void SetImage(string key) => DataManager.Instance.GetSprite(key); + + public void Show(Sprite sprite) + { + SetImage(sprite); + ShowPanel(); + } + + public void Show(string key) + { + SetImage(key); + ShowPanel(); + } + + public void Hide() + { + HidePanel(); + } + } +} \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/Game/GameUi/BaseUi/WorldUis/SpeechBubble.cs.meta b/Assets/_DDD/_Scripts/Game/GameUi/BaseUi/WorldUis/SpeechBubble.cs.meta new file mode 100644 index 000000000..7de1138b9 --- /dev/null +++ b/Assets/_DDD/_Scripts/Game/GameUi/BaseUi/WorldUis/SpeechBubble.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 9e3f3626b80543078f6df1b04dd3e5f0 +timeCreated: 1756460205 \ No newline at end of file