//-------------------------------------------------------- // [Author]: 第二世界 // [ Date ]: Wednesday, July 18, 2018 //-------------------------------------------------------- using Spine; using System; using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; //砍树获得装备界面 namespace vnxbqy.UI { public class FairyTreeAwardCell : CellView { [SerializeField] ItemCell itemCell; [SerializeField] Text unlockTxt; CutTreeModel cutTreeModel { get { return ModelCenter.Instance.GetModel(); } } public void Display(int itemID) { itemCell.Init(new ItemCellModel(itemID, false, 1)); itemCell.button.AddListener(() => { ItemTipUtility.Show(itemID); }); int unLockTreeLV = (int)TreeLVConfig.itemUnlockInfo[(object)itemID]; //如果用int访问会被误解为索引取值 导致越界 if (cutTreeModel.GetTreeLV() >= unLockTreeLV) { unlockTxt.text = Language.Get("DemonTreasureSkillGot"); unlockTxt.color = UIHelper.GetUIColor(TextColType.Green); } else { unlockTxt.text = Language.Get("TreasureSoulRealm", unLockTreeLV); } } } }