diff --git a/Assets/Script/Character/PCActor.cs b/Assets/Script/Character/PCActor.cs index 5b5e5197c..8bdb01d33 100644 --- a/Assets/Script/Character/PCActor.cs +++ b/Assets/Script/Character/PCActor.cs @@ -194,17 +194,33 @@ public class PCActor : MyActor Camera.main.fieldOfView = 60f; LoadMapMgr.Ins.Get_PortalPos(MyValue.MyChoiceMapData, portalpos => { - //Vector3 targetPosition = portalpos; - //Vector3 cameraPosition = portalpos - Vector3.forward; // 현재 카메라의 위치 - - //Vector3 relativePosition = targetPosition - cameraPosition; - //float rotateAround = Mathf.Atan2(relativePosition.x, relativePosition.z) * Mathf.Rad2Deg; - - //rotateAround += 180f; // 캐릭터 뒤에서 바라보도록 180도 보정 - - MyValue.m_RealCamera.Set_Target(transform, InGameInfo.Ins.IsGameMode(eGameMode.Lobby) ? 136.5f : 305f); + MyValue.m_RealCamera.Set_Target(transform, Get_RealCamRotAround(portalpos)); }); } + float Get_RealCamRotAround(Vector3 portalpos) + { + if (InGameInfo.Ins.IsGameMode(eGameMode.Lobby)) + return 139f; + else if (InGameInfo.Ins.IsGameMode(eGameMode.Dungeon)) + { + switch (MyValue.MyChoiceMapData.Get_MapData().e_Dungeon) + { + case eDungeon.d1_Mimic: + break; + case eDungeon.d2_Maze: return 320f; + case eDungeon.d3_Nightmare: + break; + case eDungeon.d4_Wave: + break; + } + } + + Vector3 targetPosition = portalpos; + Vector3 cameraPosition = portalpos - Vector3.forward; // 현재 카메라의 위치 + + Vector3 relativePosition = targetPosition - cameraPosition; + return Mathf.Atan2(relativePosition.x, relativePosition.z) * Mathf.Rad2Deg; + } public override void Get_Damage(DamageInfo _dinfo) { //_dinfo.Damage = 1; // 테스트 : 마녀 안 죽게 diff --git a/Assets/Script/Info/DungeonInfo.cs b/Assets/Script/Info/DungeonInfo.cs index bf0a74953..8fd4aa612 100644 --- a/Assets/Script/Info/DungeonInfo.cs +++ b/Assets/Script/Info/DungeonInfo.cs @@ -68,6 +68,7 @@ public class DungeonInfo : MonoBehaviourSingletonTemplate case eDungeon.d1_Mimic: Stop_Dungeon(true); break; case eDungeon.d2_Maze: ++m_MazeClear; + StopAllCoroutines(); // 포탈 열기 break; case eDungeon.d3_Nightmare: diff --git a/Assets/Script/UI/NewGameUI.cs b/Assets/Script/UI/NewGameUI.cs index 0d60e22f6..1612e351d 100644 --- a/Assets/Script/UI/NewGameUI.cs +++ b/Assets/Script/UI/NewGameUI.cs @@ -106,6 +106,8 @@ public class NewGameUI : MonoBehaviourSingletonTemplate if (MyValue.MyChoiceMapData.Get_MapData().e_Dungeon != eDungeon.d2_Maze) InGameInfo.Ins.Return_To_Lobby(); } + else + InGameInfo.Ins.Return_To_Lobby(); break; } }