using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; using GCGame.Table; public class WeedingBanQuetConfirmPanel : MonoBehaviour { public Image _TypeIcon; public List _TypeIconList; public List _totalSelectTypeTpggleList; public Text _CostDesc; private int _CurSelectTabId = 0; private Tab_WeedingBanQuet _table; public void InitType(int tableId) { SelectAllToggle(); _CurSelectTabId = tableId; _table = TableManager.GetWeedingBanQuetByID(_CurSelectTabId, 0); if (_table == null) return; InitTypeIcon(); InitCost(); } public void InitTypeIcon() { _TypeIcon.overrideSprite = _TypeIconList[0]; } public void InitCost() { _CostDesc.text = StrDictionary.GetClientDictionaryString("#{47410}", _table.CostVal) + GCGame.Utils.GetMoneyName(_table.CostSubClassType); } //初始化默认全部选中 public void SelectAllToggle() { for(int index = 0; index < _totalSelectTypeTpggleList.Count; index++) { _totalSelectTypeTpggleList[index].isOn = true; } } public void OnConfirmBtn() { List typeList = new List(); for (int index = 0; index < _totalSelectTypeTpggleList.Count; index++) { typeList.Add(_totalSelectTypeTpggleList[index].isOn ? 1 : 0); } ReqHoldWeddingFeast req = new ReqHoldWeddingFeast(); req.nType = _table.ID; req.nCategory = typeList; req.SendMsg(); UIManager.CloseUI(UIInfo.WeedingBanquetPanel); } public void OnAllToggle(bool isOn) { if(isOn) { _totalSelectTypeTpggleList[0].isOn = true; _totalSelectTypeTpggleList[1].isOn = true; } } public void OnCancelBtn() { UIManager.CloseUI(UIInfo.WeedingBanquetPanel); } public void OnBack() { OnCancelBtn(); } }