using System.Collections; using System.Collections.Generic; using UnityEngine; public class Content_Potion : MonoBehaviourSingletonTemplate { public UIGrid m_Grid, m_Grid_Potion; public UILabel label_potiondesc; public GameObject go_card, go_potioncard, go_btn, go_btnNoti; List list_KettlePotionCard = new List(); protected override void Awake() { base.Awake(); label_potiondesc.text = DSUtil.Format("포션을 조제할 수 있습니다.\n조제한 포션을 사용 할 수 있으며,\n사용 시 {0}분이 추가됩니다.\n포션 능력치는 중복됩니다.", MyValue.PotionAddMin); } private void OnEnable() { Set_UI(); } public void Set_UI() { var lst = table_kettle.Ins.Get_DataList(eItem.Potion); var lst_value = new List(); for (int i = 0; i < lst.Count; i++) { var val = (lst[i] as KettleTableData).Value; if (lst_value.Find(f => f == val) <= 0f) lst_value.Add(val); if (lst_value.Count == 3) break; } var lst1 = lst.FindAll(f => (f as KettleTableData).Value == lst_value[0]); var lst2 = lst.FindAll(f => (f as KettleTableData).Value == lst_value[1]); var lst3 = lst.FindAll(f => (f as KettleTableData).Value == lst_value[2]); if (list_KettlePotionCard.Count == 0) { for (int i = 0; i < 3; i++) list_KettlePotionCard.Add(DSUtil.Get_Clone(go_card, m_Grid.transform)); } list_KettlePotionCard[0].Set(lst1); list_KettlePotionCard[1].Set(lst2); list_KettlePotionCard[2].Set(lst3); go_btnNoti.SetActive(MyValue.CanCombineKettle(eItem.Potion)); GameUI.Ins.LobbyUI.Get_MenuKettle().Set_Noti(); } public void Refresh_UI() { list_KettlePotionCard.ForEach(f => f.Refresh_UI()); } public void OnClick_UseAll() { for (int i = 0; i < list_KettlePotionCard.Count; i++) list_KettlePotionCard[i].Use_AllPotion(); } public void OnClick_Combine() { GameUI.Ins.LobbyUI.Get_MenuKettle().m_KettleCombineUI.Set(go_btn); } }