22 lines
778 B
C#
22 lines
778 B
C#
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
using TMPro;
|
|
|
|
public class AreaBannerUI : MonoBehaviour
|
|
{
|
|
[Header("UI References")]
|
|
public Image bannerFrame; // 인스펙터에서 배너 이미지 오브젝트를 드래그
|
|
public TextMeshProUGUI areaName; // 텍스트 오브젝트 드래그
|
|
public TextMeshProUGUI levelInfo; // 텍스트 오브젝트 드래그
|
|
|
|
[Header("Settings")]
|
|
public float fadeDuration = 0.5f;
|
|
|
|
// 인스펙터에서 바로 내용을 바꿀 수 있는 메서드
|
|
public void SetupBanner(Sprite frameSprite, string name, string level)
|
|
{
|
|
if (bannerFrame != null) bannerFrame.sprite = frameSprite;
|
|
if (areaName != null) areaName.text = name;
|
|
if (levelInfo != null) levelInfo.text = level;
|
|
}
|
|
} |