using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; using UnityEngine.EventSystems; using System; using GCGame.Table; public struct PvpSelectItemStruct { public int type; public int param; public PvpSelectItem.OnItemClickDel itemClick; public PvpSelectItemStruct(int _type, int _param, PvpSelectItem.OnItemClickDel _ItemClick) { type = _type; param = _param; itemClick = _ItemClick; } } public class PvpSelectItem : UIItemBase { private enum SelectItemTypeEnum { Segment = 0, PassWord = 1, } public Text _Desc; public int _Type; // public int param; public GameObject _MarkIcon; public delegate void OnItemClickDel(int type); private OnItemClickDel _ItemClick = null; public override void Show(Hashtable hash) { base.Show(hash); PvpSelectItemStruct info = (PvpSelectItemStruct)hash["InitObj"]; _Type = info.type; param = info.param; _ItemClick = info.itemClick; InitShow(); } public void InitShow() { if(_Type == (int)SelectItemTypeEnum.Segment) //段位 { if (param == 0) { _Desc.text = StrDictionary.GetClientDictionaryString("#{82036}"); } else { _Desc.text = GameManager.gameManager.PlayerDataPool.pvpIfo.GetSegmentGradeDesc(param); } } else { if (param == 0) { _Desc.text = StrDictionary.GetClientDictionaryString("#{82036}"); } else { _Desc.text = StrDictionary.GetClientDictionaryString("#{82038}"); ; } } } public override void OnItemClick() { base.OnItemClick(); if (_ItemClick != null) _ItemClick.Invoke(param); } public void ShowMarkIcon(bool isShow) { _MarkIcon.SetActive(isShow); } }