//--------------------------------------------------------
|
// [Author]: 第二世界
|
// [ Date ]: Saturday, August 18, 2018
|
//--------------------------------------------------------
|
|
using System;
|
using System.Collections;
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
using UnityEngine.UI;
|
|
namespace vnxbqy.UI {
|
|
public class TreasureSoulActiveWin : Window
|
{
|
[SerializeField] Image m_Icon;
|
[SerializeField] Text m_SoulName;
|
[SerializeField] Text m_Description;
|
[SerializeField] Button m_Close;
|
|
[SerializeField, Header("至少显示秒数")] float m_OverTime = 2f;
|
|
DateTime openTime = DateTime.Now;
|
|
public static int treasureSoulId = 0;
|
#region Built-in
|
protected override void BindController()
|
{
|
}
|
|
protected override void AddListeners()
|
{
|
m_Close.onClick.AddListener(OnClose);
|
}
|
|
protected override void OnPreOpen()
|
{
|
openTime = DateTime.Now;
|
Display();
|
}
|
|
protected override void OnAfterOpen()
|
{
|
}
|
|
protected override void OnPreClose()
|
{
|
}
|
|
protected override void OnAfterClose()
|
{
|
}
|
#endregion
|
private void OnClose()
|
{
|
if ((DateTime.Now - openTime).TotalSeconds >= m_OverTime)
|
{
|
CloseClick();
|
}
|
}
|
|
private void Display()
|
{
|
var config = TreasurePrivilegeConfig.Get(treasureSoulId);
|
if (config != null)
|
{
|
m_Icon.SetSprite(config.Icon);
|
m_SoulName.text = config.Name;
|
m_Description.text = config.Description;
|
}
|
}
|
}
|
|
}
|
|
|
|
|