| | |
| | | {
|
| | | public class ClientHazyPreciousDungeonStage : DungeonStage
|
| | | {
|
| | | readonly Vector3 s_PlayerPosition = new Vector3(17.609f, 5.469f, 2.233f);
|
| | | readonly Vector3 s_BossPosition = new Vector3(11.46125f, 5.810412f, 11.24522f);
|
| | | readonly Vector3 s_PreciousPosition = new Vector3(5.76f, 6.708447f, 23.48f);
|
| | | readonly Vector3 s_PreciousEffectPosition = new Vector3(5.8f, 6.708447f, 23.34f);
|
| | | readonly Vector3 s_IndicationPosition = new Vector3(12.1f, 6f, 11.95f);
|
| | | readonly Vector3 s_IndicationAngle = new Vector3(0, -30.74f, 0);
|
| | |
|
| | | readonly float s_BossAngle = 148.57f;
|
| | | readonly float s_PreciousAngle = -29.531f;
|
| | | readonly float s_PreciousEffectAngle = 77f;
|
| | |
|
| | | int m_LineId = 0;
|
| | |
|
| | |
| | | int m_PreciousEffectNpcId = 0;
|
| | |
|
| | | SFXController m_Indication;
|
| | | SFXController m_PreciousEffect;
|
| | | Clock m_PrepareClock;
|
| | |
|
| | | GA_NpcClientFightBoss clientBoss;
|
| | | GA_NpcClientCollect clientPrecious;
|
| | | GA_NpcClientFightNorm clientPreciousEffect;
|
| | |
|
| | | Step m_Step = Step.None;
|
| | | Step step
|
| | |
| | | case Step.Prepare:
|
| | | break;
|
| | | case Step.Fight:
|
| | | if (clientBoss.ActorInfo.serverDie)
|
| | | if (clientBoss != null && clientBoss.ActorInfo.serverDie)
|
| | | {
|
| | | step = Step.Collect;
|
| | | }
|
| | |
| | | {
|
| | | base.OnStageLoadFinish();
|
| | |
|
| | | StartCoroutine(Co_VerityExistBossShow());
|
| | |
|
| | | InitializePlayer();
|
| | | InitializeNpc();
|
| | | }
|
| | |
|
| | | private IEnumerator Co_VerityExistBossShow()
|
| | | {
|
| | | yield return WaitingForSecondConst.WaitMS500;
|
| | | if (!BossShowModel.Instance.BossShowing)
|
| | | {
|
| | | BossShowCompletedEvent();
|
| | | }
|
| | | }
|
| | |
|
| | | public override void UnInitialize()
|
| | |
| | |
|
| | | UnloadAssets();
|
| | |
|
| | | StopAllCoroutines();
|
| | |
|
| | | BossShowModel.Instance.bossShowCompletedEvent -= BossShowCompletedEvent;
|
| | | }
|
| | |
|
| | | private void InitializePlayer()
|
| | | {
|
| | |
|
| | | var hero = PlayerDatas.Instance.hero;
|
| | | if (hero != null)
|
| | | {
|
| | | hero.Pos = s_PlayerPosition;
|
| | | }
|
| | | }
|
| | |
|
| | | private void InitializeNpc()
|
| | | {
|
| | | clientBoss = GAMgr.Instance.ReqClntFightNpc<GA_NpcClientFightBoss>((uint)m_BossNpcId, E_ActorGroup.Enemy);
|
| | | clientBoss.Pos = s_BossPosition;
|
| | | clientBoss.Rotation = Quaternion.Euler(0, s_BossAngle, 0);
|
| | |
|
| | | clientPrecious = GAMgr.Instance.ReqClntNoFightNpc<GA_NpcClientCollect>((uint)m_PreciousNpcId, E_ActorGroup.FuncNpc);
|
| | | clientPreciousEffect = GAMgr.Instance.ReqClntFightNpc<GA_NpcClientFightNorm>((uint)m_PreciousEffectNpcId, E_ActorGroup.Enemy);
|
| | | clientPrecious.Pos = s_PreciousPosition;
|
| | | clientPrecious.Rotation = Quaternion.Euler(0, s_PreciousAngle, 0);
|
| | |
|
| | | var npcConfig = NPCConfig.Get(m_PreciousEffectNpcId);
|
| | | m_PreciousEffect = SFXPlayUtility.Instance.PlayWithEulerAngle(npcConfig.NPCEffect, s_PreciousEffectPosition
|
| | | , new Vector3(0, s_PreciousEffectAngle, 0));
|
| | | var animator = m_PreciousEffect.GetComponentInChildren<Animator>(true);
|
| | | if (animator != null)
|
| | | {
|
| | | animator.Play(GAStaticDefine.State_IdleHash);
|
| | | }
|
| | | }
|
| | |
|
| | | void OnEnterPrepare()
|
| | |
| | |
|
| | | var seconds = GetStepSeconds(Step.Fight);
|
| | | model.UpdateCoolDown(DungeonCoolDownType.FightStart, (uint)seconds * 1000);
|
| | |
|
| | | UpdateMissionData();
|
| | | }
|
| | |
|
| | | void OnExitFight()
|
| | | {
|
| | | GAMgr.Instance.ServerDie(clientPreciousEffect.ServerInstID);
|
| | | var animator = m_PreciousEffect.GetComponentInChildren<Animator>(true);
|
| | | if (animator != null)
|
| | | {
|
| | | animator.Play(GAStaticDefine.State_DeadHash);
|
| | | }
|
| | | }
|
| | |
|
| | | void OnEnterCollect()
|
| | | {
|
| | | m_Indication = SFXPlayUtility.Instance.PlayWithEulerAngle(1051, s_IndicationPosition, s_IndicationAngle);
|
| | |
|
| | | UpdateMissionData();
|
| | | }
|
| | |
|
| | | int GetStepSeconds(Step step)
|
| | |
| | |
|
| | | private void UpdateMissionData()
|
| | | {
|
| | | //var npcTotal = 0;
|
| | | //if(step==Step.)
|
| | | //var missionData = new DungeonMissionData()
|
| | | //{
|
| | | // lineID = m_LineId,
|
| | | // step = (int)step < (int)Step.Collect ? 1 : 2,
|
| | | // npcTotal = 0,
|
| | | //};
|
| | | //model.UpdateFakeDungeonMission(ClientHazyPreciousDungeon.DATAMAP, missionData);
|
| | | var npcTotal = 0;
|
| | | var missionData = new DungeonMissionData()
|
| | | {
|
| | | lineID = m_LineId,
|
| | | step = (int)step < (int)Step.Collect ? 1 : 2,
|
| | | npcTotal = npcTotal,
|
| | | };
|
| | | model.UpdateFakeDungeonMission(ClientHazyPreciousDungeon.DATAMAP, missionData);
|
| | | }
|
| | |
|
| | | void UnloadAssets()
|
| | |
| | | clientPrecious = null;
|
| | | }
|
| | |
|
| | | if (clientPreciousEffect != null)
|
| | | if (m_PreciousEffect != null)
|
| | | {
|
| | | GAMgr.Instance.ServerDie(clientPreciousEffect.ServerInstID);
|
| | | GAMgr.Instance.Release(clientPreciousEffect);
|
| | | clientPreciousEffect = null;
|
| | | SFXPlayUtility.Instance.Release(m_PreciousEffect);
|
| | | m_PreciousEffect = null;
|
| | | }
|
| | | }
|
| | |
|