| | |
| | | using Snxxz.UI;
|
| | | using System;
|
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | |
| | | static Clock s_StepClock = null; |
| | | |
| | | Step m_Step = Step.None; |
| | | Step step
|
| | | public Step step
|
| | | {
|
| | | get { return m_Step; }
|
| | | set
|
| | |
| | | {
|
| | | case Step.Prepare:
|
| | | OnExitPrepare();
|
| | | break;
|
| | | case Step.Fight:
|
| | | OnExitFight();
|
| | | break;
|
| | | }
|
| | |
|
| | |
| | | OnEnterFight();
|
| | | break;
|
| | | case Step.Over:
|
| | | OnEnterOver();
|
| | | break;
|
| | | }
|
| | | }
|
| | | }
|
| | | } |
| | | |
| | | }
|
| | |
|
| | | static PersonalBossModel model { get { return ModelCenter.Instance.GetModel<PersonalBossModel>(); } } |
| | | static DungeonModel dungeonModel { get { return ModelCenter.Instance.GetModel<DungeonModel>(); } } |
| | | |
| | |
| | | s_StepTimes = LitJson.JsonMapper.ToObject<int[]>(dungeonConfig.StepTime);
|
| | | }
|
| | | }
|
| | |
|
| | | dungeonModel.onDungeonResultEvent += OnDungeonResultEvent;
|
| | | } |
| | | |
| | | protected override void OnStageLoadFinish()
|
| | |
| | | {
|
| | | InitializeNpc();
|
| | |
|
| | | var seconds = s_StepTimes[0];
|
| | | dungeonModel.UpdateCoolDown(DungeonCoolDownType.WaitStart, (uint)seconds * 1000);
|
| | | var seconds = s_StepTimes[1];
|
| | | dungeonModel.UpdateCoolDown(DungeonCoolDownType.FightStart, (uint)seconds * 1000);
|
| | |
|
| | | s_StepClock = Clock.AlarmAfter(seconds, () =>
|
| | | {
|
| | | step = Step.Fight;
|
| | | ClientDungeonStageUtility.ExitNormalClientDungeon();
|
| | | });
|
| | | } |
| | | |
| | | private void OnExitFight()
|
| | | {
|
| | | if (s_StepClock != null)
|
| | | {
|
| | | Clock.Stop(s_StepClock);
|
| | | s_StepClock = null;
|
| | | }
|
| | | } |
| | | |
| | | private void OnEnterOver()
|
| | | {
|
| | | ClientDungeonStageUtility.ClearClientDataMapSymbol();
|
| | |
|
| | | var seconds = s_StepTimes[2];
|
| | | dungeonModel.UpdateCoolDown(DungeonCoolDownType.LeaveMap, (uint)seconds * 1000);
|
| | | s_StepClock = Clock.AlarmAfter(seconds, () =>
|
| | | {
|
| | | ClientDungeonStageUtility.ExitNormalClientDungeon();
|
| | | });
|
| | | } |
| | | |
| | |
| | | PersonalEnemy.Create((uint)model.clientBossNpcId, E_ActorGroup.Enemy, s_NpcPosition);
|
| | | } |
| | | |
| | | private void OnDungeonResultEvent()
|
| | | {
|
| | | step = Step.Over;
|
| | | } |
| | | |
| | | public override void UnInitialize()
|
| | | {
|
| | | base.UnInitialize();
|
| | |
|
| | | dungeonModel.onDungeonResultEvent -= OnDungeonResultEvent;
|
| | |
|
| | | if (s_StepClock != null)
|
| | | {
|
| | |
| | | }
|
| | | #endif |
| | | |
| | | enum Step
|
| | | public enum Step
|
| | | {
|
| | | None,
|
| | | Prepare,
|