//--------------------------------------------------------
|
// [Author]: 第二世界
|
// [ Date ]: Tuesday, November 28, 2017
|
//--------------------------------------------------------
|
|
using System;
|
using System.Collections;
|
using System.Collections.Generic;
|
using UnityEngine;
|
using UnityEngine.UI;
|
|
namespace Snxxz.UI
|
{
|
|
public class ViewFuncPowerWin : Window
|
{
|
[SerializeField] Button closeBtn;
|
[SerializeField] Text playerNameTxt;
|
[SerializeField] Text fightPowerTxt;
|
[SerializeField] ScrollerController scrollerController;
|
|
RoleParticularModel m_Model;
|
RoleParticularModel model
|
{
|
get
|
{
|
return m_Model ?? (m_Model = ModelCenter.Instance.GetModel<RoleParticularModel>());
|
}
|
}
|
#region Built-in
|
protected override void BindController()
|
{
|
}
|
|
protected override void AddListeners()
|
{
|
closeBtn.onClick.AddListener(CloseClick);
|
}
|
|
protected override void OnPreOpen()
|
{
|
OnShowRoleFightPower();
|
}
|
|
protected override void OnAfterOpen()
|
{
|
}
|
|
protected override void OnPreClose()
|
{
|
}
|
|
protected override void OnAfterClose()
|
{
|
}
|
#endregion
|
|
private void OnShowRoleFightPower()
|
{
|
RoleParticularModel.ViewPlayerData viewPlayerData = model.GetViewPlayerData(model.viewPlayer);
|
scrollerController.Refresh();
|
if (viewPlayerData != null)
|
{
|
playerNameTxt.text = Language.Get("CheckRoleName", viewPlayerData.rolePropData.Name);
|
fightPowerTxt.text = StringUtility.Contact(Language.Get("RoleParticularWin_3"), UIHelper.ReplaceLargeNum(viewPlayerData.rolePropData.FightPower));
|
|
var configs = ViewRoleFuncConfig.GetValues();
|
foreach (var cfg in configs)
|
{
|
if (cfg.func == 0 || FuncOpen.Instance.IsFuncOpen(cfg.func))
|
{
|
scrollerController.AddCell(ScrollerDataType.Header, cfg.id);
|
}
|
}
|
}
|
scrollerController.Restart();
|
}
|
|
}
|
|
}
|