| | |
| | | using Snxxz.UI; |
| | | using UnityEngine.SceneManagement; |
| | | using UnityEngine; |
| | | using System;
|
| | |
|
| | | using System; |
| | | |
| | | public class AdventureStage : Singleton<AdventureStage> |
| | | { |
| | | public bool IsInAdventureStage { get; private set; } |
| | |
| | | |
| | | public void Enter() |
| | | { |
| | | IsInAdventureStage = true;
|
| | | IsInAdventureStage = true; |
| | | ClientDungeonStageUtility.RequestStartClientDungeon(0, 0); |
| | | m_CacheHeroPos = PlayerDatas.Instance.hero.Pos; |
| | | SnxxzGame.Instance.StartCoroutine(_Enter()); |
| | |
| | | |
| | | private IEnumerator _Enter() |
| | | { |
| | | WindowCenter.Instance.Open<LoadingWin>();
|
| | | WindowCenter.Instance.Open<LoadingWin>(); |
| | | WindowCenter.Instance.Close<MainInterfaceWin>(); |
| | | if (!AssetSource.sceneFromEditor) |
| | | { |
| | |
| | | if (_hero != null) |
| | | { |
| | | _hero.Pos = new Vector3(9.517f, 18.742f, 7.485f); |
| | | _hero.Behaviour.StopHandupAI(); |
| | | _hero.Behaviour.StopKillUntilDieAI(); |
| | | } |
| | | CameraController.Instance.Apply(); |
| | | yield return null; |
| | | WindowCenter.Instance.Close<LoadingWin>();
|
| | | WindowCenter.Instance.Open<MainInterfaceWin>();
|
| | | WindowCenter.Instance.Close<LoadingWin>(); |
| | | WindowCenter.Instance.Open<MainInterfaceWin>(); |
| | | BossShowModel.Instance.bossShowCompletedEvent -= BossShowCompletedEvent; |
| | | BossShowModel.Instance.bossShowCompletedEvent += BossShowCompletedEvent; |
| | | |
| | | if (onLoadAdventureStage != null)
|
| | | {
|
| | | onLoadAdventureStage();
|
| | | if (onLoadAdventureStage != null) |
| | | { |
| | | onLoadAdventureStage(); |
| | | } |
| | | }
|
| | |
|
| | | private void BossShowCompletedEvent()
|
| | | {
|
| | | } |
| | | |
| | | private void BossShowCompletedEvent() |
| | | { |
| | | m_Npc = GAMgr.Instance.ReqClntNoFightNpc<GA_NpcClientFunc>((uint)hazyRegionModel.GetAdventureNpcId(), E_ActorGroup.FuncNpc); |
| | | m_Npc.Pos = new Vector3(9.012f, 18.76f, 9.089f); |
| | | m_Npc.Rotation = Quaternion.Euler(0f, 165f, 0f); |
| | | NPCInteractProcessor.s_NpcInteractEvent -= OnNpcTalkEvent; |
| | | NPCInteractProcessor.s_NpcInteractEvent += OnNpcTalkEvent;
|
| | | }
|
| | |
|
| | | NPCInteractProcessor.s_NpcInteractEvent += OnNpcTalkEvent; |
| | | } |
| | | |
| | | private IEnumerator _Exit() |
| | | { |
| | | NPCInteractProcessor.s_NpcInteractEvent -= OnNpcTalkEvent;
|
| | | NPCInteractProcessor.s_NpcInteractEvent -= OnNpcTalkEvent; |
| | | BossShowModel.Instance.bossShowCompletedEvent -= BossShowCompletedEvent; |
| | | GAMgr.Instance.ServerDie(m_Npc.ServerInstID); |
| | | GAMgr.Instance.Release(m_Npc); |
| | | |
| | | WindowCenter.Instance.Open<LoadingWin>();
|
| | | WindowCenter.Instance.Open<LoadingWin>(); |
| | | WindowCenter.Instance.Close<MainInterfaceWin>(); |
| | | var _async = SceneManager.UnloadSceneAsync("Map140_Qy"); |
| | | yield return _async; |
| | |
| | | _hero.Pos = m_CacheHeroPos; |
| | | } |
| | | CameraController.Instance.Apply(); |
| | | yield return null;
|
| | | yield return null; |
| | | WindowCenter.Instance.Open<MainInterfaceWin>(); |
| | | WindowCenter.Instance.Close<LoadingWin>();
|
| | | WindowCenter.Instance.Close<LoadingWin>(); |
| | | |
| | | if (onExitAdventureStage != null)
|
| | | {
|
| | | onExitAdventureStage();
|
| | | if (onExitAdventureStage != null) |
| | | { |
| | | onExitAdventureStage(); |
| | | } |
| | | } |
| | | |
| | |
| | | if (m_Npc.NpcConfig.NPCID == npcid |
| | | && m_Npc.ServerInstID == sid) |
| | | { |
| | | if (!WindowCenter.Instance.IsOpen<HazyRegionDialogueWin>())
|
| | | {
|
| | | if (!WindowCenter.Instance.IsOpen<HazyRegionDialogueWin>()) |
| | | { |
| | | hazyRegionModel.StartAdventureDialogue(); |
| | | } |
| | | } |