말풍선 로직 추가

This commit is contained in:
NTG 2025-08-29 19:02:35 +09:00
parent da03795275
commit 778629883c
4 changed files with 54 additions and 0 deletions

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: e9bb6d801f134399b78da0f0cc842713
timeCreated: 1756456534

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 2abcf465835f4bc6ac505c1df0988753
timeCreated: 1756460193

View File

@ -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();
}
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 9e3f3626b80543078f6df1b04dd3e5f0
timeCreated: 1756460205