using TMPro; using UnityEngine; using UnityEngine.UI; #if UNITY_EDITOR using UnityEditor; [CustomEditor(typeof(ShopCard))] [CanEditMultipleObjects] // πŸ”‘ μ—¬λŸ¬ 였브젝트 λ™μ‹œ 지원 public class ShopCardEditor : Editor { public override void OnInspectorGUI() { base.OnInspectorGUI(); if (GUILayout.Button("πŸ”„ Auto Link Components (All Selected)")) { foreach (Object obj in targets) // πŸ”‘ μ„ νƒλœ λͺ¨λ“  ShopCard 순회 { ShopCard shopCard = obj as ShopCard; if (shopCard != null) { shopCard.AutoLink(); EditorUtility.SetDirty(shopCard); // λ³€κ²½ 사항 기둝 } } } } } #endif public class ShopCard : MonoBehaviour { public string m_ID; public Image i_shopitem, i_buymoney; public TextMeshProUGUI t_name, t_peakefficiency; public TextMeshProUGUI t_amount, t_goods; public TextMeshProUGUI t_price, t_limit, t_pricelimit, t_buymoneyprice, t_sale; public GameObject go_btnbuy, go_btnbuylimit, go_btnbuymoney, go_initDesc, go_BuyComplete; shoptabledata m_Data; #if UNITY_EDITOR // μžλ™ μ—°κ²° ν•¨μˆ˜ (λ²„νŠΌμ—μ„œ 호좜) public void AutoLink() { i_shopitem = DSUtil.Get_Child_T(gameObject, "i_shopitem"); i_buymoney = DSUtil.Get_Child_T(gameObject, "i_buymoney"); t_name = DSUtil.Get_Child_T(gameObject, "t_name"); t_peakefficiency = DSUtil.Get_Child_T(gameObject, "t_peakefficiency"); t_amount = DSUtil.Get_Child_T(gameObject, "t_amount"); t_goods = DSUtil.Get_Child_T(gameObject, "t_goods"); t_price = DSUtil.Get_Child_T(gameObject, "t_price"); t_limit = DSUtil.Get_Child_T(gameObject, "t_limit"); t_pricelimit = DSUtil.Get_Child_T(gameObject, "t_pricelimit"); t_buymoneyprice = DSUtil.Get_Child_T(gameObject, "t_buymoneyprice"); t_sale = DSUtil.Get_Child_T(gameObject, "t_sale"); go_BuyComplete = DSUtil.Get_Child_GameObject(gameObject, "BuyComplete"); go_initDesc = DSUtil.Get_Child_GameObject(gameObject, "go_initDesc"); go_btnbuy = DSUtil.Get_Child_GameObject(gameObject, "btn_buy"); go_btnbuylimit = DSUtil.Get_Child_GameObject(gameObject, "btn_buylimit"); go_btnbuymoney = DSUtil.Get_Child_GameObject(gameObject, "btn_buymoney"); } #endif private void Awake() { var btn = go_btnbuy.GetComponent