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