//-------------------------------------------------------- // [Author]: 第二世界 // [ Date ]: Thursday, August 16, 2018 //-------------------------------------------------------- using UnityEngine; using System.Collections; using UnityEngine.UI; using System.Collections.Generic; using TableConfig; //神兽强化;列表条目 namespace Snxxz.UI { public class GodBeastEntry : MonoBehaviour { [SerializeField] ItemCell m_itemCell; [SerializeField] GameObject m_Selectedbar_Image; [SerializeField] Text m_Item_Text; [SerializeField] Button m_GodBeastButton; public Button GodBeastButton { get { return m_GodBeastButton; } set { m_GodBeastButton = value; } } DogzModel Dogz_model; DogzModel dogz_model { get { return Dogz_model ?? (Dogz_model = ModelCenter.Instance.GetModel()); } } public void GetGodBeastLocationMarker(int locationMarker, int currentlySelected) { int godBeastNumber = locationMarker % 100;//神兽编号 int godBeastPart = locationMarker / 100;//神兽装备位ID List itemModel = dogz_model.GetDogzEquips(godBeastNumber); if (itemModel != null) { for (int i = 0; i < itemModel.Count; i++) { if (itemModel[i].EquipPlace == godBeastPart) { ItemCellModel ItemModel = new ItemCellModel(itemModel[i].itemId, true, 0, 1); m_itemCell.Init(ItemModel); var itemConfig = Config.Instance.Get(itemModel[i].itemId); var IudetDogzEquipPlus = itemModel[i].GetUseDataModel((int)ItemUseDataKey.Def_IudetDogzEquipPlus);// 神兽装备强化信息列表 [强化等级, 强化熟练度] m_Item_Text.color = UIHelper.GetUIColor(itemConfig.ItemColor); if (IudetDogzEquipPlus != null && IudetDogzEquipPlus[0] > 0) { m_Item_Text.text = itemConfig.ItemName+" +"+ IudetDogzEquipPlus[0]; } else { m_Item_Text.text = itemConfig.ItemName; } if (locationMarker == currentlySelected) { m_Selectedbar_Image.SetActive(true); } else { m_Selectedbar_Image.SetActive(false); } } } } } } }