말풍선 로직 추가
This commit is contained in:
parent
da03795275
commit
778629883c
3
Assets/_DDD/_Scripts/Game/GameObject.meta
Normal file
3
Assets/_DDD/_Scripts/Game/GameObject.meta
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: e9bb6d801f134399b78da0f0cc842713
|
||||||
|
timeCreated: 1756456534
|
3
Assets/_DDD/_Scripts/Game/GameUi/BaseUi/WorldUis.meta
Normal file
3
Assets/_DDD/_Scripts/Game/GameUi/BaseUi/WorldUis.meta
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 2abcf465835f4bc6ac505c1df0988753
|
||||||
|
timeCreated: 1756460193
|
@ -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();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 9e3f3626b80543078f6df1b04dd3e5f0
|
||||||
|
timeCreated: 1756460205
|
Loading…
Reference in New Issue
Block a user