//--------------------------------------------------------
|
// [Author]: 第二世界
|
// [ Date ]: Wednesday, November 22, 2017
|
//--------------------------------------------------------
|
|
using System;
|
using System.Collections;
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
using UnityEngine.UI;
|
//功能预告面板
|
namespace Snxxz.UI
|
{
|
|
public class FunctionForecastWin : Window
|
{
|
[SerializeField] Button CloseBtn;
|
[SerializeField] Image FunctionImage;
|
[SerializeField] Text IconText;
|
[SerializeField] Text ContentText;
|
[SerializeField] Text ContentText1;
|
#region Built-in
|
private int OpenID = 0;
|
protected override void BindController()
|
{
|
}
|
|
protected override void AddListeners()
|
{
|
CloseBtn.AddListener(() => { Close(); });
|
}
|
|
protected override void OnPreOpen()
|
{
|
if (WindowCenter.Instance.IsOpen<CombatModeWin>())
|
{
|
WindowCenter.Instance.Close<CombatModeWin>();
|
}
|
OpenID = FunctionForecastTip.OpenTag;
|
FunctionForecastTip.FunctionOpenTagEvent += OnFunctionOpenTag;
|
}
|
|
protected override void OnAfterOpen()
|
{
|
Assignment();
|
}
|
|
void Assignment()
|
{
|
var functionForcecastConfig = FunctionForecastConfig.Get(OpenID);
|
if (functionForcecastConfig == null)
|
{
|
Close();
|
}
|
var openLvConfig = FuncOpenLVConfig.Get(OpenID);
|
|
FunctionImage.SetSprite(functionForcecastConfig.FuncIconKey);
|
IconText.text = functionForcecastConfig.FuncName;
|
ContentText.text = functionForcecastConfig.DetailDescribe;
|
ContentText1.text = functionForcecastConfig.OpenDescribe;
|
}
|
|
protected override void OnPreClose()
|
{
|
FunctionForecastTip.FunctionOpenTagEvent -= OnFunctionOpenTag;
|
}
|
|
private void OnFunctionOpenTag(int obj)
|
{
|
OpenID = obj;
|
Assignment();
|
}
|
|
protected override void OnAfterClose()
|
{
|
}
|
#endregion
|
|
}
|
|
}
|
|
|
|
|