using System; using TMPro; using UnityEngine; using UnityEngine.Events; using UnityEngine.UI; /// /// 원하는 스크립트에서 메서드 만들고 {버튼}.Bind(메서드) 하면 클릭시 메서드 실행 /// public class UIButton: MonoBehaviour { private string _name; public string Name { get { return _name; } private set { _name = value; _button.gameObject.name = _name; } } private Button _button; // 모든 버튼의 백그라운드 동작은 항상 private Image _background; private GameObject _stackView; private Image _image; private TextMeshProUGUI _text; public enum Button_Objects { Button, BackGround, Stack, Image, Text, }; private void Awake() { if (_button == null) _button = GetComponent