| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: 第二世界 |
| | | // [ Date ]: Friday, June 29, 2018 |
| | | //-------------------------------------------------------- |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | using UnityEngine.UI; |
| | | using System.Collections.Generic; |
| | | using TableConfig; |
| | | using Snxxz.UI; |
| | | using System; |
| | | |
| | | public class CoinTaskTipModel : Model, IBeforePlayerDataInitialize, IPlayerLoginOk |
| | | { |
| | | |
| | | public bool IsPopup = false;//赏金 |
| | | public bool IsinDungeon = false; |
| | | |
| | | public bool IsFairy = false;//仙盟 |
| | | public bool IsinDungeon1 = false; |
| | | |
| | | public override void Init() |
| | | { |
| | | |
| | | } |
| | | public override void UnInit() |
| | | { |
| | | |
| | | } |
| | | public void OnBeforePlayerDataInitialize() |
| | | { |
| | | IsPopup = false; |
| | | IsFairy = false; |
| | | IsinDungeon = false; |
| | | IsinDungeon1 = false; |
| | | |
| | | } |
| | | |
| | | public void OnPlayerLoginOk() |
| | | { |
| | | PlayerTaskDatas.TaskCoinTaskEvent -= TaskCoinTaskEvent; |
| | | PlayerTaskDatas.TaskCoinTaskEvent += TaskCoinTaskEvent; |
| | | |
| | | PlayerTaskDatas.FairyTaskEvent -= FairyTaskEvent; |
| | | PlayerTaskDatas.FairyTaskEvent += FairyTaskEvent; |
| | | StageManager.Instance.onStageLoadFinish -= onStageLoadFinish; |
| | | StageManager.Instance.onStageLoadFinish += onStageLoadFinish; |
| | | } |
| | | |
| | | |
| | | |
| | | private void onStageLoadFinish() |
| | | { |
| | | if (IsinDungeon) |
| | | { |
| | | SnxxzGame.Instance.StartCoroutine(PopupPanel()); |
| | | IsinDungeon = false; |
| | | } |
| | | if (IsinDungeon1) |
| | | { |
| | | SnxxzGame.Instance.StartCoroutine(FairyAuTaskPanel()); |
| | | IsinDungeon1 = false; |
| | | } |
| | | } |
| | | |
| | | private bool IsDungeon()//判断是否在副本中 |
| | | { |
| | | var mapId = PlayerDatas.Instance.baseData.MapID; |
| | | var mapConfig = ConfigManager.Instance.GetTemplate<MapConfig>(mapId); |
| | | return mapConfig != null && mapConfig.MapFBType != 0; |
| | | } |
| | | |
| | | private void TaskCoinTaskEvent() |
| | | { |
| | | int GetCylinderNumber = TaskAllocation.Instance.ForRingAllNumber();//获取赏金总环数 |
| | | if (GetCylinderNumber == 10) |
| | | { |
| | | var inDungeon = IsDungeon(); |
| | | if (inDungeon) |
| | | { |
| | | IsinDungeon = true; |
| | | } |
| | | else |
| | | { |
| | | SnxxzGame.Instance.StartCoroutine(PopupPanel()); |
| | | } |
| | | } |
| | | } |
| | | private void FairyTaskEvent() |
| | | { |
| | | int GetFairyAuNumber = TaskAllocation.Instance.FairyAuNumber();//获取仙盟单轮完成环数 |
| | | int AllFairyAuNumber = TaskAllocation.Instance.FairyAuAllNumber();//获取仙盟总环数 |
| | | if (GetFairyAuNumber == 10 && AllFairyAuNumber<70) |
| | | { |
| | | var inDungeon = IsDungeon(); |
| | | if (inDungeon) |
| | | { |
| | | IsinDungeon1 = true; |
| | | } |
| | | else |
| | | { |
| | | SnxxzGame.Instance.StartCoroutine(FairyAuTaskPanel()); |
| | | } |
| | | |
| | | } |
| | | } |
| | | private IEnumerator PopupPanel() |
| | | { |
| | | yield return WaitingForSecondConst.WaitMS1500; |
| | | if (NewBieCenter.Instance.inGuiding || ModelCenter.Instance.GetModel<TreasureModel>().newGotShowing || WindowCenter.Instance.CheckOpen<TreasureLevelUpWin>()) |
| | | { |
| | | yield break; |
| | | } |
| | | IsPopup = true; |
| | | if (WindowCenter.Instance.CheckOpen<MainInterfaceWin>()) |
| | | { |
| | | WindowJumpMgr.Instance.WindowJumpTo(JumpUIType.BountyInterface); |
| | | } |
| | | } |
| | | |
| | | private IEnumerator FairyAuTaskPanel() |
| | | { |
| | | yield return WaitingForSecondConst.WaitMS1500; |
| | | if (NewBieCenter.Instance.inGuiding || ModelCenter.Instance.GetModel<TreasureModel>().newGotShowing || WindowCenter.Instance.CheckOpen<TreasureLevelUpWin>()) |
| | | { |
| | | yield break; |
| | | } |
| | | IsFairy = true; |
| | | if (WindowCenter.Instance.CheckOpen<MainInterfaceWin>()) |
| | | { |
| | | WindowJumpMgr.Instance.WindowJumpTo(JumpUIType.UnionTask); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | //--------------------------------------------------------
|
| | | // [Author]: 第二世界
|
| | | // [ Date ]: Friday, June 29, 2018
|
| | | //--------------------------------------------------------
|
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | | using UnityEngine.UI;
|
| | | using System.Collections.Generic;
|
| | | using TableConfig;
|
| | | using Snxxz.UI;
|
| | | using System;
|
| | |
|
| | | public class CoinTaskTipModel : Model, IBeforePlayerDataInitialize, IPlayerLoginOk
|
| | | {
|
| | |
|
| | | public bool IsPopup = false;//赏金
|
| | | public bool IsinDungeon = false;
|
| | |
|
| | | public bool IsFairy = false;//仙盟
|
| | | public bool IsinDungeon1 = false;
|
| | |
|
| | | public override void Init()
|
| | | {
|
| | | |
| | | }
|
| | | public override void UnInit()
|
| | | {
|
| | |
|
| | | }
|
| | | public void OnBeforePlayerDataInitialize()
|
| | | {
|
| | | IsPopup = false;
|
| | | IsFairy = false;
|
| | | IsinDungeon = false;
|
| | | IsinDungeon1 = false;
|
| | |
|
| | | }
|
| | |
|
| | | public void OnPlayerLoginOk()
|
| | | {
|
| | | PlayerTaskDatas.TaskCoinTaskEvent -= TaskCoinTaskEvent;
|
| | | PlayerTaskDatas.TaskCoinTaskEvent += TaskCoinTaskEvent;
|
| | |
|
| | | PlayerTaskDatas.FairyTaskEvent -= FairyTaskEvent;
|
| | | PlayerTaskDatas.FairyTaskEvent += FairyTaskEvent;
|
| | | StageManager.Instance.onStageLoadFinish -= onStageLoadFinish;
|
| | | StageManager.Instance.onStageLoadFinish += onStageLoadFinish;
|
| | | }
|
| | |
|
| | | |
| | |
|
| | | private void onStageLoadFinish()
|
| | | {
|
| | | if (IsinDungeon)
|
| | | {
|
| | | SnxxzGame.Instance.StartCoroutine(PopupPanel());
|
| | | IsinDungeon = false;
|
| | | }
|
| | | if (IsinDungeon1)
|
| | | {
|
| | | SnxxzGame.Instance.StartCoroutine(FairyAuTaskPanel());
|
| | | IsinDungeon1 = false;
|
| | | }
|
| | | }
|
| | |
|
| | | private bool IsDungeon()//判断是否在副本中
|
| | | {
|
| | | var mapId = PlayerDatas.Instance.baseData.MapID;
|
| | | var mapConfig = Config.Instance.Get<MapConfig>(mapId);
|
| | | return mapConfig != null && mapConfig.MapFBType != 0;
|
| | | }
|
| | |
|
| | | private void TaskCoinTaskEvent()
|
| | | {
|
| | | int GetCylinderNumber = TaskAllocation.Instance.ForRingAllNumber();//获取赏金总环数
|
| | | var inDungeon = IsDungeon();
|
| | | if (GetCylinderNumber == 10)
|
| | | { |
| | | if (inDungeon)
|
| | | {
|
| | | IsinDungeon = true;
|
| | | }
|
| | | else
|
| | | {
|
| | | SnxxzGame.Instance.StartCoroutine(PopupPanel());
|
| | | }
|
| | | }
|
| | | if (GetCylinderNumber == 20)
|
| | | {
|
| | | if (!inDungeon)
|
| | | {
|
| | | SnxxzGame.Instance.StartCoroutine(PopupPanel());
|
| | | }
|
| | | }
|
| | | }
|
| | | private void FairyTaskEvent()
|
| | | {
|
| | | int GetFairyAuNumber = TaskAllocation.Instance.FairyAuNumber();//获取仙盟单轮完成环数
|
| | | if (GetFairyAuNumber == 10)
|
| | | {
|
| | | var inDungeon = IsDungeon();
|
| | | if (inDungeon)
|
| | | {
|
| | | IsinDungeon1 = true;
|
| | | }
|
| | | else
|
| | | {
|
| | | SnxxzGame.Instance.StartCoroutine(FairyAuTaskPanel());
|
| | | }
|
| | |
|
| | | }
|
| | | }
|
| | | private IEnumerator PopupPanel()
|
| | | {
|
| | | yield return WaitingForSecondConst.WaitMS1500;
|
| | | if (NewBieCenter.Instance.inGuiding || ModelCenter.Instance.GetModel<TreasureModel>().newGotShowing || WindowCenter.Instance.CheckOpen<TreasureLevelUpWin>())
|
| | | {
|
| | | yield break;
|
| | | }
|
| | | if (WindowCenter.Instance.CheckOpen<TaskWin>())
|
| | | {
|
| | | yield break;
|
| | | }
|
| | | int GetCylinderNumber = TaskAllocation.Instance.ForRingAllNumber();//获取赏金总环数
|
| | | if (GetCylinderNumber == 10)
|
| | | {
|
| | | IsPopup = true;
|
| | | } |
| | | if (WindowCenter.Instance.CheckOpen<MainInterfaceWin>())
|
| | | {
|
| | | WindowJumpMgr.Instance.WindowJumpTo(JumpUIType.BountyInterface);
|
| | | } |
| | | }
|
| | |
|
| | | private IEnumerator FairyAuTaskPanel()
|
| | | {
|
| | | yield return WaitingForSecondConst.WaitMS1500;
|
| | | if (NewBieCenter.Instance.inGuiding || ModelCenter.Instance.GetModel<TreasureModel>().newGotShowing || WindowCenter.Instance.CheckOpen<TreasureLevelUpWin>())
|
| | | {
|
| | | yield break;
|
| | | }
|
| | | if (WindowCenter.Instance.CheckOpen<FairyAuTaskWin>())
|
| | | {
|
| | | yield break;
|
| | | }
|
| | | int AllFairyAuNumber = TaskAllocation.Instance.FairyAuAllNumber();//获取仙盟总环数
|
| | | if (AllFairyAuNumber < 70)
|
| | | {
|
| | | IsFairy = true;
|
| | | } |
| | | if (WindowCenter.Instance.CheckOpen<MainInterfaceWin>())
|
| | | {
|
| | | WindowJumpMgr.Instance.WindowJumpTo(JumpUIType.UnionTask);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
|