| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: 第二世界 |
| | | // [ Date ]: Tuesday, January 23, 2018 |
| | | //-------------------------------------------------------- |
| | | |
| | | using System; |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | namespace Snxxz.UI { |
| | | |
| | | public class DogzWin : Window |
| | | { |
| | | |
| | | [SerializeField] Button m_CloseBtn; |
| | | [SerializeField] Button m_LeftBtn; |
| | | [SerializeField] Button m_RightBtn; |
| | | [SerializeField] FunctionButton functionButtonDogz; |
| | | [SerializeField] FunctionButton functionButtonStrengthen; |
| | | [SerializeField] FunctionButtonGroup funcBtnGroup; |
| | | |
| | | DogzModel dogzModel { get { return ModelCenter.Instance.GetModel<DogzModel>(); } } |
| | | protected override void BindController() |
| | | { |
| | | } |
| | | |
| | | protected override void AddListeners() |
| | | { |
| | | m_CloseBtn.onClick.AddListener(OnClose); |
| | | functionButtonDogz.onClick.AddListener(OnDogz); |
| | | functionButtonStrengthen.onClick.AddListener(OnDogzStrengthen); |
| | | m_LeftBtn.onClick.AddListener(() => { |
| | | funcBtnGroup.TriggerLast(); |
| | | }); |
| | | m_RightBtn.onClick.AddListener(() => { |
| | | funcBtnGroup.TriggerNext(); |
| | | }); |
| | | } |
| | | |
| | | private void OnDogzStrengthen() |
| | | { |
| | | CloseChild(); |
| | | functionOrder = 1; |
| | | WindowCenter.Instance.Open<GodBeastReinforcementWin>(); |
| | | } |
| | | |
| | | private void OnDogz() |
| | | { |
| | | CloseChild(); |
| | | functionOrder = 0; |
| | | WindowCenter.Instance.Open<DogzActiveWin>(); |
| | | } |
| | | |
| | | protected override void OnPreOpen() |
| | | { |
| | | dogzModel.SetDefaultSelectDogz(); |
| | | } |
| | | |
| | | protected override void OnActived() |
| | | { |
| | | base.OnActived(); |
| | | funcBtnGroup.TriggerByOrder(functionOrder); |
| | | } |
| | | |
| | | protected override void OnAfterOpen() |
| | | { |
| | | |
| | | } |
| | | |
| | | protected override void OnPreClose() |
| | | { |
| | | } |
| | | |
| | | protected override void OnAfterClose() |
| | | { |
| | | //--------------------------------------------------------
|
| | | // [Author]: 第二世界
|
| | | // [ Date ]: Tuesday, January 23, 2018
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using System;
|
| | | using System.Collections;
|
| | | using System.Collections.Generic;
|
| | | using UnityEngine;
|
| | | using UnityEngine.UI;
|
| | |
|
| | | namespace Snxxz.UI {
|
| | |
|
| | | public class DogzWin : Window
|
| | | {
|
| | |
|
| | | [SerializeField] Button m_CloseBtn;
|
| | | [SerializeField] Button m_LeftBtn;
|
| | | [SerializeField] Button m_RightBtn;
|
| | | [SerializeField] FunctionButton functionButtonDogz;
|
| | | [SerializeField] FunctionButton functionButtonStrengthen;
|
| | | [SerializeField] FunctionButtonGroup funcBtnGroup;
|
| | |
|
| | | DogzModel dogzModel { get { return ModelCenter.Instance.GetModel<DogzModel>(); } }
|
| | | protected override void BindController()
|
| | | {
|
| | | }
|
| | |
|
| | | protected override void AddListeners()
|
| | | {
|
| | | m_CloseBtn.onClick.AddListener(OnClose);
|
| | | functionButtonDogz.onClick.AddListener(OnDogz);
|
| | | functionButtonStrengthen.onClick.AddListener(OnDogzStrengthen);
|
| | | m_LeftBtn.onClick.AddListener(() => {
|
| | | funcBtnGroup.TriggerLast();
|
| | | });
|
| | | m_RightBtn.onClick.AddListener(() => {
|
| | | funcBtnGroup.TriggerNext();
|
| | | });
|
| | | }
|
| | |
|
| | | private void OnDogzStrengthen()
|
| | | {
|
| | | CloseChild();
|
| | | functionOrder = 1;
|
| | | WindowCenter.Instance.Open<GodBeastReinforcementWin>();
|
| | | }
|
| | |
|
| | | private void OnDogz()
|
| | | {
|
| | | CloseChild();
|
| | | functionOrder = 0;
|
| | | WindowCenter.Instance.Open<DogzActiveWin>();
|
| | | }
|
| | |
|
| | | protected override void OnPreOpen()
|
| | | {
|
| | | dogzModel.SetDefaultSelectDogz();
|
| | | }
|
| | |
|
| | | 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>();
|
| | | } |
| | | } |
| | | |
| | | void OnClose() |
| | | { |
| | | CloseChild(); |
| | | CloseImmediately(); |
| | | } |
| | | |
| | | void CloseChild() |
| | | { |
| | | if (WindowCenter.Instance.CheckOpen<DogzActiveWin>()) |
| | | { |
| | | WindowCenter.Instance.CloseImmediately<DogzActiveWin>(); |
| | | } |
| | | if (WindowCenter.Instance.CheckOpen<GodBeastReinforcementWin>()) |
| | | { |
| | | WindowCenter.Instance.CloseImmediately<GodBeastReinforcementWin>(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | }
|
| | | }
|
| | |
|
| | | void OnClose()
|
| | | {
|
| | | CloseChild();
|
| | | CloseImmediately();
|
| | | }
|
| | |
|
| | | void CloseChild()
|
| | | {
|
| | | if (WindowCenter.Instance.CheckOpen<DogzActiveWin>())
|
| | | {
|
| | | WindowCenter.Instance.CloseImmediately<DogzActiveWin>();
|
| | | }
|
| | | if (WindowCenter.Instance.CheckOpen<GodBeastReinforcementWin>())
|
| | | {
|
| | | WindowCenter.Instance.CloseImmediately<GodBeastReinforcementWin>();
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
|