//--------------------------------------------------------
|
// [Author]: 第二世界
|
// [ Date ]: Thursday, August 16, 2018
|
//--------------------------------------------------------
|
using UnityEngine;
|
using System.Collections;
|
using UnityEngine.UI;
|
using System.Collections.Generic;
|
|
//神兽强化;列表条目
|
namespace vnxbqy.UI
|
{
|
|
public class GodBeastEntry : MonoBehaviour
|
{
|
[SerializeField] ItemCell m_itemCell;
|
[SerializeField] Text m_StarLabel;
|
[SerializeField] GameObject m_Selectedbar_Image;
|
[SerializeField] Text m_Item_Text;
|
[SerializeField] Button m_GodBeastButton;
|
[SerializeField] RedpointBehaviour m_RedPoint;
|
[SerializeField] Image m_GodBeastIcon;
|
public float Magnification = 1f;
|
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<DogzModel>()); } }
|
GodBeastModel godBeastModel { get { return ModelCenter.Instance.GetModel<GodBeastModel>(); } }
|
public void GetGodBeastLocationMarker(int locationMarker, int currentlySelected)
|
{
|
int godBeastNumber = locationMarker % 100;//神兽编号
|
int godBeastPart = locationMarker / 100;//神兽装备位ID
|
var DogZConfig = DogzConfig.Get(godBeastNumber);
|
if (DogZConfig != null)
|
{
|
m_GodBeastIcon.SetSprite(DogZConfig.HeadIcon);
|
m_GodBeastIcon.SetNativeSize();
|
m_GodBeastIcon.transform.localScale = Vector3.one * Magnification;
|
}
|
List<ItemModel> itemModel = dogz_model.GetDogzEquips(godBeastNumber);
|
if (itemModel != null)
|
{
|
for (int i = 0; i < itemModel.Count; i++)
|
{
|
if (itemModel[i].config.EquipPlace == godBeastPart)
|
{
|
ItemCellModel ItemModel = new ItemCellModel(itemModel[i].itemId, true, 0);//不显示绑定
|
if (godBeastModel.GodBeastRedPointDic.ContainsKey(itemModel[i].gridIndex))
|
{
|
m_RedPoint.redpointId = godBeastModel.GodBeastRedPointDic[(itemModel[i].gridIndex)].id;
|
}
|
m_itemCell.Init(ItemModel);
|
m_StarLabel.text = dogz_model.GetStarLevelLabel(itemModel[i].config.StarLevel);
|
var itemConfig = ItemConfig.Get(itemModel[i].itemId);
|
var IudetDogzEquipPlus = itemModel[i].GetUseData((int)ItemUseDataKey.dogzEquipPlus);// 神兽装备强化信息列表 [强化等级, 强化熟练度]
|
m_Item_Text.color = UIHelper.GetUIColor(itemConfig.ItemColor);
|
if (IudetDogzEquipPlus != null && IudetDogzEquipPlus[0] > 0)
|
{
|
string str= itemConfig.ItemName + " +" + IudetDogzEquipPlus[0];
|
m_Item_Text.text = UIHelper.AppendColor(itemConfig.ItemColor, str, true);
|
}
|
else
|
{
|
string str = itemConfig.ItemName;
|
m_Item_Text.text = UIHelper.AppendColor(itemConfig.ItemColor, str, true);
|
}
|
if (locationMarker == currentlySelected)
|
{
|
m_Selectedbar_Image.SetActive(true);
|
}
|
else
|
{
|
m_Selectedbar_Image.SetActive(false);
|
}
|
}
|
}
|
}
|
}
|
}
|
|
}
|
|
|
|