//--------------------------------------------------------
|
// [Author]: 第二世界
|
// [ Date ]: Monday, January 21, 2019
|
//--------------------------------------------------------
|
|
using System;
|
using System.Collections;
|
using System.Collections.Generic;
|
using UnityEngine;
|
using UnityEngine.UI;
|
using TableConfig;
|
|
namespace Snxxz.UI
|
{
|
|
public class JadeDynastyTowerHintWin : Window
|
{
|
[SerializeField] Text m_Floor;
|
[SerializeField] ItemBehaviour m_Reward;
|
[SerializeField] RectTransform m_UnLockEquipPlace;
|
[SerializeField] Text m_Description;
|
|
JadeDynastyTowerModel model { get { return ModelCenter.Instance.GetModel<JadeDynastyTowerModel>(); } }
|
|
#region Built-in
|
protected override void BindController()
|
{
|
}
|
|
protected override void AddListeners()
|
{
|
}
|
|
protected override void OnPreOpen()
|
{
|
Display();
|
}
|
|
protected override void OnAfterOpen()
|
{
|
}
|
|
protected override void OnPreClose()
|
{
|
}
|
|
protected override void OnAfterClose()
|
{
|
}
|
#endregion
|
|
private void Display()
|
{
|
var config = Config.Instance.Get<JadeDynastyTowerConfig>(model.currentFloor);
|
m_Floor.text = config.floorName;
|
var isLastFloor = model.IsTopFloor(model.currentFloor);
|
|
if (model.currentFloor > model.highestPassFloor)
|
{
|
var isSpecialFloor = config.unLockEquipPlace > 0;
|
if (isSpecialFloor)
|
{
|
m_UnLockEquipPlace.gameObject.SetActive(true);
|
m_Reward.gameObject.SetActive(false);
|
}
|
else
|
{
|
m_UnLockEquipPlace.gameObject.SetActive(false);
|
m_Reward.gameObject.SetActive(true);
|
m_Reward.SetItem(config.rewardIdsFirstS[0], config.rewardCountsFirstS[0]);
|
}
|
|
m_Description.text = config.specialRewardDescription;
|
}
|
else
|
{
|
m_Reward.gameObject.SetActive(true);
|
m_UnLockEquipPlace.gameObject.SetActive(false);
|
m_Reward.SetItem(config.rewardIdsLevelS[0], config.rewardCountsLevelS[0]);
|
|
var itemConfig = Config.Instance.Get<ItemConfig>(config.rewardIdsLevelS[0]);
|
m_Description.text = Language.Get("JadeDynastyNameReward", itemConfig.ItemName);
|
}
|
|
}
|
|
}
|
|
}
|