//-------------------------------------------------------- // [Author]: 玩个游戏 // [ Date ]: Tuesday, July 24, 2018 //-------------------------------------------------------- using System; using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class MainBossEnterWin : UIBase { [SerializeField] Text fbNameText; [SerializeField] Button CloseBtn; [SerializeField] Button rankBtn; [SerializeField] Button fightBtn; protected override void InitComponent() { CloseBtn.AddListener(CloseWindow); rankBtn.AddListener(() => { RankModel.Instance.ResetQueryParam(); RankModel.Instance.QueryRankByPage(0, watchID: (int)PlayerDatas.Instance.baseData.PlayerID); var win = UIManager.Instance.OpenWindow(); win.rankType = 0; }); fightBtn.AddListener(FightBoss); } protected override void OnPreOpen() { } protected override void OnPreClose() { } void Display() { var canChallengeBoss = AutoFightModel.Instance.CanChallengeBoss(); fightBtn.interactable = canChallengeBoss; fightBtn.SetColorful(null, canChallengeBoss); } void FightBoss() { if (AutoFightModel.Instance.CanChallengeBoss()) { BattleManager.Instance.MainFightRequest(3); } } }