using System.Collections;
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
using UnityEngine.UI;
|
namespace Snxxz.UI
|
{
|
[XLua.Hotfix]
|
public class GatherSoulTipProperty : MonoBehaviour, IGatherSoulTipScrollPart
|
{
|
[SerializeField] PropertyBehaviour[] m_Propertys;
|
[SerializeField] RectTransform m_ContainerNone;
|
|
GatheringSoulModel model
|
{
|
get { return ModelCenter.Instance.GetModel<GatheringSoulModel>(); }
|
}
|
|
public void Display(int id, int level)
|
{
|
var itemConfig = ItemConfig.Get(id);
|
bool isSoulEssence = itemConfig.Type == GatheringSoulModel.GATHERSOUL_ESSENCE_TYPE;
|
m_ContainerNone.gameObject.SetActive(isSoulEssence);
|
List<int> list = null;
|
if (!isSoulEssence)
|
{
|
list = model.gatherSoulPropertys[id];
|
}
|
for (int i = 0; i < m_Propertys.Length; i++)
|
{
|
m_Propertys[i].gameObject.SetActive(list != null && i < list.Count);
|
if (list != null && i < list.Count)
|
{
|
var propertyValue = model.GetPropertyValue(id, list[i], level);
|
m_Propertys[i].DisplayUpper(list[i], propertyValue);
|
}
|
}
|
}
|
|
public float GetHeight()
|
{
|
return (this.transform as RectTransform).sizeDelta.y;
|
}
|
}
|
}
|