using System;
|
using System.Collections;
|
using System.Collections.Generic;
|
using UnityEngine;
|
using UnityEngine.UI;
|
|
namespace Snxxz.UI
|
{
|
public class TreasureSoulPattern2 : TreasureSoulPattern
|
{
|
[SerializeField] RectTransform m_ContainerPresentNone;
|
[SerializeField] RectTransform m_ContainerPresentHas;
|
[SerializeField] RectTransform m_ContainerNextNone;
|
[SerializeField] RectTransform m_ContainerNextHas;
|
[SerializeField] List<PropertyBehaviour> m_PresentProperties;
|
[SerializeField] List<PropertyBehaviour> m_NextProperties;
|
[SerializeField] Button m_Goto;
|
[SerializeField] Button m_Get;
|
[SerializeField] Text m_Progress;
|
[SerializeField] Image m_Complete;
|
|
private void Awake()
|
{
|
m_Goto.onClick.AddListener(OnGoto);
|
m_Get.onClick.AddListener(OnGet);
|
}
|
|
public override void Display(int _id)
|
{
|
base.Display(_id);
|
Display();
|
}
|
|
protected override void TreasurePrivilegeUpdateEvent(int _id)
|
{
|
base.TreasurePrivilegeUpdateEvent(_id);
|
if (_id == (int)TreasurePrivilege.StrengthenAdd)
|
{
|
Display();
|
}
|
}
|
|
public override void Dispose()
|
{
|
base.Dispose();
|
}
|
|
private void Display()
|
{
|
var configs = Config.Instance.GetAllValues<ItemPlusSumAttrConfig>();
|
var present = -1;
|
var next = 0;
|
for (int i = 0; i < configs.Count; i++)
|
{
|
if (special.presentFinishCount >= configs[i].countNeed)
|
{
|
present = i;
|
}
|
}
|
next = present + 1;
|
m_ContainerPresentNone.gameObject.SetActive(present == -1);
|
m_ContainerPresentHas.gameObject.SetActive(present >= 0);
|
if (present >= 0)
|
{
|
var config = configs[present];
|
for (int i = 0; i < m_PresentProperties.Count; i++)
|
{
|
m_PresentProperties[i].gameObject.SetActive(i < config.attType.Length);
|
if (i < config.attType.Length)
|
{
|
m_PresentProperties[i].DisplayUpper(config.attType[i], config.attValue[i]);
|
}
|
}
|
}
|
m_ContainerNextNone.gameObject.SetActive(next >= configs.Count);
|
m_ContainerNextHas.gameObject.SetActive(next < configs.Count);
|
if (next < configs.Count)
|
{
|
var config = configs[next];
|
for (int i = 0; i < m_NextProperties.Count; i++)
|
{
|
m_NextProperties[i].gameObject.SetActive(i < config.attType.Length);
|
if (i < config.attType.Length)
|
{
|
m_NextProperties[i].DisplayUpper(config.attType[i], config.attValue[i]);
|
}
|
}
|
}
|
m_Complete.gameObject.SetActive(special.state == TreasurePrivilegeState.Complete);
|
m_Goto.gameObject.SetActive(special.state == TreasurePrivilegeState.Doing);
|
m_Get.gameObject.SetActive(special.state == TreasurePrivilegeState.Reward);
|
m_Progress.text = special.ProgressDisplay();
|
//m_Progress.color = specialData.state == TreasurePrivilegeState.Doing ? UIHelper.GetUIColor(TextColType.Red, true) : UIHelper.GetUIColor(TextColType.Green, true);
|
}
|
|
private void OnGoto()
|
{
|
WindowJumpMgr.Instance.WindowJumpTo(JumpUIType.RebornOpenStrength);
|
model.gotoSoul = (int)special.type;
|
}
|
|
private void OnGet()
|
{
|
special.GetReward();
|
}
|
}
|
}
|