using System;
|
using System.Collections;
|
using System.Collections.Generic;
|
using UnityEngine;
|
using UnityEngine.UI;
|
//强化系统的控制
|
namespace Snxxz.UI
|
{
|
public class EquipReinforceWin : Window
|
{
|
|
private WingsRedDot W_ModelRedDit;
|
private WingsRedDot model { get { return W_ModelRedDit ?? (W_ModelRedDit = ModelCenter.Instance.GetModel<WingsRedDot>()); } }
|
private PlayerStrengthengDatas M_Strengtheng;
|
private PlayerStrengthengDatas strengtheng { get { return M_Strengtheng ?? (M_Strengtheng = ModelCenter.Instance.GetModel<PlayerStrengthengDatas>()); } }
|
private WashTips _washTips;
|
public WashTips WashTip {
|
get {
|
if (_washTips == null)
|
_washTips = transform.Find("CommonPanel/WashTips").GetComponent<WashTips>();
|
return _washTips;
|
}
|
}
|
private Button _closeBtn;
|
|
private EquipSuitTips _suitTips;
|
public EquipSuitTips SuitTips {
|
get {
|
if (_suitTips == null)
|
_suitTips = transform.Find("CommonPanel/EquipSuitPanel").GetComponent<EquipSuitTips>();
|
return _suitTips;
|
}
|
}
|
|
private StrengtheningSripts _strengtheningPanel;
|
public StrengtheningSripts StrengthenPnl {
|
get {
|
if (_strengtheningPanel == null)
|
_strengtheningPanel = transform.Find("CommonPanel/StrengtheningPanel").GetComponent<StrengtheningSripts>();
|
return _strengtheningPanel;
|
|
}
|
}
|
|
private Button _prePageBtn;
|
private Button _nextPageBtn;
|
private FunctionButton _strengthTitle; //强化
|
private FunctionButton _inlayTitle; //镶嵌
|
private FunctionButton _wingsRefineTitle; // 翅膀精炼
|
private FunctionButton _equipSuitTitle; // 套装
|
private FunctionButton _washTitle; //洗练
|
private FunctionButtonGroup _funcBtnGroup;
|
|
private GameObject _InlaidGemPanel; //宝石
|
private GameObject _wingsRefinePanel;
|
|
EquipWashModel m_EquipWashModel;
|
EquipWashModel equipWashModel {
|
get {
|
return m_EquipWashModel ?? (m_EquipWashModel = ModelCenter.Instance.GetModel<EquipWashModel>());
|
}
|
}
|
|
GemModel m_gemModel;
|
GemModel gemModel {
|
get {
|
return m_gemModel ?? (m_gemModel = ModelCenter.Instance.GetModel<GemModel>());
|
}
|
}
|
WingsRedDot m_WingsRedDot;
|
WingsRedDot wingsRedDot {
|
get {
|
return m_WingsRedDot ?? (m_WingsRedDot = ModelCenter.Instance.GetModel<WingsRedDot>());
|
}
|
}
|
protected override void BindController()
|
{
|
_InlaidGemPanel = transform.Find("CommonPanel/InlaidGemPanel").gameObject;
|
_wingsRefinePanel = transform.Find("CommonPanel/WingsRefinePanel").gameObject;
|
_funcBtnGroup = transform.Find("Container_Functions").GetComponent<FunctionButtonGroup>();
|
_strengthTitle = transform.Find("Container_Functions/Btn_Function_1").GetComponent<FunctionButton>();
|
_inlayTitle = transform.Find("Container_Functions/Btn_Function_2").GetComponent<FunctionButton>();
|
_wingsRefineTitle = transform.Find("Container_Functions/Btn_Function_3").GetComponent<FunctionButton>();
|
_equipSuitTitle = transform.Find("Container_Functions/Btn_Function_4").GetComponent<FunctionButton>();
|
_washTitle = transform.Find("Container_Functions/Btn_Function_5").GetComponent<FunctionButton>();
|
_prePageBtn = transform.Find("LeftBtn").GetComponent<Button>();
|
_nextPageBtn = transform.Find("RightBtn").GetComponent<Button>();
|
_closeBtn = transform.Find("CloseBtn").GetComponent<Button>();
|
|
}
|
|
protected override void AddListeners()
|
{
|
_strengthTitle.onClick.AddListener(OnClickStrengthTitle);
|
_inlayTitle.onClick.AddListener(OnClickInlayTitle);
|
_wingsRefineTitle.onClick.AddListener(OnClickWingsRefine);
|
_equipSuitTitle.onClick.AddListener(OnClickEquipSuit);
|
_washTitle.onClick.AddListener(OnClickItemWashTitle);
|
_prePageBtn.onClick.AddListener(OnClickLeftBtn);
|
_nextPageBtn.onClick.AddListener(OnClickRightBtn);
|
_closeBtn.onClick.AddListener(OnClickCloseBtn);
|
}
|
|
protected override void OnPreOpen()
|
{
|
StrengthenPnl.gameObject.SetActive(false);
|
_InlaidGemPanel.gameObject.SetActive(false);
|
WashTip.gameObject.SetActive(false);
|
SuitTips.gameObject.SetActive(false);
|
_wingsRefinePanel.SetActive(false);
|
|
if (!WindowJumpMgr.Instance.IsJumpState)
|
{
|
if (functionOrder == 0)
|
{
|
if (strengtheng.redPointStre.state == RedPointState.Simple)
|
{
|
functionOrder = _strengthTitle.order;
|
}
|
else if (gemModel.gemTagRedPoint.state == RedPointState.Simple)
|
{
|
functionOrder = _inlayTitle.order;
|
}
|
else if (wingsRedDot.redPointStre.state == RedPointState.Simple)
|
{
|
functionOrder = _wingsRefineTitle.order;
|
}
|
else if (MainRedDot.Instance.redPointSuitFunc.state == RedPointState.Simple)
|
{
|
functionOrder = _equipSuitTitle.order;
|
}
|
else if (MainRedDot.Instance.redPointWashFunc.state == RedPointState.Simple)
|
{
|
functionOrder = _washTitle.order;
|
}
|
|
}
|
}
|
|
}
|
|
protected override void OnActived()
|
{
|
base.OnActived();
|
_funcBtnGroup.TriggerByOrder(functionOrder);
|
}
|
|
protected override void OnAfterOpen()
|
{
|
|
}
|
|
protected override void OnPreClose()
|
{
|
|
}
|
|
protected override void OnAfterClose()
|
{
|
if (!WindowJumpMgr.Instance.IsJumpState)
|
{
|
WindowCenter.Instance.Open<MainInterfaceWin>();
|
}
|
}
|
|
private void OnClickRightBtn()
|
{
|
_funcBtnGroup.TriggerNext();
|
}
|
|
private void OnClickLeftBtn()
|
{
|
_funcBtnGroup.TriggerLast();
|
}
|
|
private void OnClickItemWashTitle()
|
{
|
if (StrengthenPnl.gameObject.activeSelf)
|
{
|
StrengthenPnl.gameObject.SetActive(false);
|
}
|
|
_InlaidGemPanel.gameObject.SetActive(false);
|
WashTip.gameObject.SetActive(true);
|
SuitTips.gameObject.SetActive(false);
|
_wingsRefinePanel.SetActive(false);
|
functionOrder = _washTitle.order;
|
}
|
|
private void OnClickEquipSuit()
|
{
|
equipWashModel.SetCurWashModel(0);
|
if (StrengthenPnl.gameObject.activeSelf)
|
{
|
StrengthenPnl.gameObject.SetActive(false);
|
}
|
_InlaidGemPanel.gameObject.SetActive(false);
|
WashTip.gameObject.SetActive(false);
|
_wingsRefinePanel.SetActive(false);
|
SuitTips.gameObject.SetActive(true);
|
functionOrder = _equipSuitTitle.order;
|
}
|
|
private void OnClickWingsRefine()
|
{
|
equipWashModel.SetCurWashModel(0);
|
if (StrengthenPnl.gameObject.activeSelf)
|
{
|
StrengthenPnl.gameObject.SetActive(false);
|
}
|
_InlaidGemPanel.gameObject.SetActive(false);
|
WashTip.gameObject.SetActive(false);
|
SuitTips.gameObject.SetActive(false);
|
_wingsRefinePanel.SetActive(true);
|
model.redPointStre.state = RedPointState.None;
|
functionOrder = _wingsRefineTitle.order;
|
}
|
|
private void OnClickInlayTitle()
|
{
|
equipWashModel.SetCurWashModel(0);
|
if (StrengthenPnl.gameObject.activeSelf)
|
{
|
StrengthenPnl.gameObject.SetActive(false);
|
}
|
_InlaidGemPanel.gameObject.SetActive(true);
|
WashTip.gameObject.SetActive(false);
|
SuitTips.gameObject.SetActive(false);
|
_wingsRefinePanel.SetActive(false);
|
functionOrder = _inlayTitle.order;
|
}
|
|
private void OnClickStrengthTitle()
|
{
|
equipWashModel.SetCurWashModel(0);
|
StrengthenPnl.gameObject.SetActive(true);
|
_InlaidGemPanel.gameObject.SetActive(false);
|
WashTip.gameObject.SetActive(false);
|
SuitTips.gameObject.SetActive(false);
|
_wingsRefinePanel.SetActive(false);
|
functionOrder = _strengthTitle.order;
|
}
|
|
public void OnClickCloseBtn()
|
{
|
EquipReinforceModel.Instance.funcTitle = EquipReinforceFuncTitle.Strength;
|
CloseImmediately();
|
}
|
|
}
|
}
|
|