| | |
| | | public class FindPreciousBossRebornBehaviour : MonoBehaviour
|
| | | {
|
| | | [SerializeField] RectTransform m_ContainerBossReborn;
|
| | | [SerializeField] Text m_BossRebornTimer;
|
| | | [SerializeField] Image m_BossIcon;
|
| | | [SerializeField] Text m_BossName;
|
| | | [SerializeField] Text m_BossLevel;
|
| | | [SerializeField] Button m_Goto;
|
| | | [SerializeField] Button m_Close;
|
| | |
|
| | | float timer = 0f;
|
| | | MapModel mapModel { get { return ModelCenter.Instance.GetModel<MapModel>(); } }
|
| | | FindPreciousModel model { get { return ModelCenter.Instance.GetModel<FindPreciousModel>(); } }
|
| | | DungeonModel dungeonModel { get { return ModelCenter.Instance.GetModel<DungeonModel>(); } }
|
| | |
| | | {
|
| | | m_Goto.AddListener(GotoKillBoss);
|
| | | m_Close.AddListener(ReportConfirmBossRebornNotify);
|
| | | timer = 0f;
|
| | | DisplayRebornCountDown();
|
| | | }
|
| | |
|
| | | private void LateUpdate()
|
| | | {
|
| | | timer += Time.deltaTime;
|
| | | if (timer > 1f)
|
| | | {
|
| | | timer = 0f;
|
| | | DisplayRebornCountDown();
|
| | | }
|
| | | }
|
| | |
|
| | | private void OnDisable()
|
| | |
| | |
|
| | | if (mapConfig.MapFBType == (int)MapType.OpenCountry)
|
| | | {
|
| | | EnterBossHome(config.FloorNum,_bossId);
|
| | | EnterBossHome(config.FloorNum, _bossId);
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | private void EnterBossHome(int _floor,int _bossId)
|
| | | private void EnterBossHome(int _floor, int _bossId)
|
| | | {
|
| | | var error = 0;
|
| | | if (TestEnterBossHomeDungeon(_floor, out error))
|
| | |
| | | return true;
|
| | | }
|
| | |
|
| | | private void DisplayRebornCountDown()
|
| | | {
|
| | | var bossId = model.currentBossNotify;
|
| | | if (model.IsBossAlive(bossId))
|
| | | {
|
| | | m_BossRebornTimer.text = Language.Get("BossAlreadyReborn");
|
| | | }
|
| | | else
|
| | | {
|
| | | FindPreciousModel.BossInfo bossInfo;
|
| | | if (model.TryGetBossInfo(bossId, out bossInfo))
|
| | | {
|
| | | var rebornCountDown = (int)(bossInfo.refreshTime - TimeUtility.ServerNow).TotalSeconds;
|
| | | if (rebornCountDown < 1)
|
| | | {
|
| | | m_BossRebornTimer.text = Language.Get("BossAlreadyReborn");
|
| | | }
|
| | | else
|
| | | {
|
| | | m_BossRebornTimer.text = Language.Get("BossRebornCountDown", rebornCountDown);
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | | }
|
| | |
|
| | | }
|