DEG-133 [Feat] 맵 통합
This commit is contained in:
parent
7d51909f0c
commit
4309c2851e
@ -56,6 +56,11 @@ public class PlayerController : CharacterBase, IObserver<GameObject>
|
||||
Joystick = FindObjectOfType<FixedJoystick>();
|
||||
}
|
||||
|
||||
// isBattle 초기화 (임시)
|
||||
bool isHousingScene = SceneManager.GetActiveScene().name.Contains("Housing");
|
||||
_isBattle = !isHousingScene;
|
||||
Debug.Log("_isBattle: " + _isBattle);
|
||||
|
||||
AssignCharacterController();
|
||||
AssignAnimator();
|
||||
}
|
||||
@ -67,13 +72,6 @@ public class PlayerController : CharacterBase, IObserver<GameObject>
|
||||
hitEffectController = GetComponentInChildren<PlayerHitEffectController>();
|
||||
|
||||
PlayerInit();
|
||||
|
||||
// isBattle 초기화 (임시)
|
||||
/*bool isHousingScene = SceneManager.GetActiveScene().name.Contains("Housing");
|
||||
_isBattle = !isHousingScene;
|
||||
Debug.Log("_isBattle: " + _isBattle);*/
|
||||
|
||||
SwitchBattleMode();
|
||||
}
|
||||
|
||||
private void Update()
|
||||
@ -263,6 +261,7 @@ public class PlayerController : CharacterBase, IObserver<GameObject>
|
||||
/// </summary>
|
||||
private void AssignCharacterController()
|
||||
{
|
||||
Debug.Log("AssignCharacterController: " + _isBattle);
|
||||
_characterController = _isBattle
|
||||
? battleModel.GetComponent<CharacterController>()
|
||||
: normalModel.GetComponent<CharacterController>();
|
||||
|
BIN
Assets/JYY/Prefabs/Alien Big Blink.prefab
(Stored with Git LFS)
BIN
Assets/JYY/Prefabs/Alien Big Blink.prefab
(Stored with Git LFS)
Binary file not shown.
BIN
Assets/JYY/Prefabs/[Enemy] PldDog.prefab
(Stored with Git LFS)
BIN
Assets/JYY/Prefabs/[Enemy] PldDog.prefab
(Stored with Git LFS)
Binary file not shown.
@ -10,6 +10,9 @@ public class DungeonLogic : MonoBehaviour
|
||||
[NonSerialized] public bool isCompleted = false; // 던전 클리어 여부
|
||||
[NonSerialized] public bool isFailed = false; // 던전 실패 여부
|
||||
|
||||
[SerializeField] private List<GameObject> bossPrefabs;
|
||||
[SerializeField] private Transform spawnPosition; // 보스가 스폰될 위치
|
||||
|
||||
private PlayerController _player;
|
||||
private EnemyController _enemy;
|
||||
|
||||
@ -17,11 +20,15 @@ public class DungeonLogic : MonoBehaviour
|
||||
public event Action OnDungeonSuccess;
|
||||
public event Action OnDungeonFailure;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
SpawnBossForCurrentStage();
|
||||
}
|
||||
|
||||
private void Start()
|
||||
{
|
||||
// tag를 통해 할당 / 추후 플레이어와 에너미 태그 추가 필요
|
||||
_player = GameObject.FindGameObjectWithTag("Player").GetComponent<PlayerController>();
|
||||
_enemy = GameObject.FindGameObjectWithTag("Enemy").GetComponent<EnemyController>();
|
||||
|
||||
// 죽음 이벤트 구독
|
||||
if (_player != null)
|
||||
@ -29,6 +36,17 @@ public class DungeonLogic : MonoBehaviour
|
||||
_player.OnGetHit += OnPlayerGetHit;
|
||||
_player.OnDeath += OnPlayerDeath;
|
||||
}
|
||||
}
|
||||
|
||||
private void SpawnBossForCurrentStage()
|
||||
{
|
||||
int currentStage = GameManager.Instance.StageLevel;
|
||||
|
||||
if (currentStage <= bossPrefabs.Count && currentStage > 0)
|
||||
{
|
||||
GameObject bossPrefab = bossPrefabs[currentStage - 1];
|
||||
GameObject bossObj = Instantiate(bossPrefab, spawnPosition.position, Quaternion.identity);
|
||||
_enemy = bossObj.GetComponent<EnemyController>();
|
||||
|
||||
if (_enemy != null)
|
||||
{
|
||||
@ -36,6 +54,7 @@ public class DungeonLogic : MonoBehaviour
|
||||
_enemy.OnDeath += OnEnemyDeath;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void OnPlayerGetHit(CharacterBase player)
|
||||
{
|
||||
@ -52,6 +71,8 @@ public class DungeonLogic : MonoBehaviour
|
||||
|
||||
private void OnEnemyGetHit(CharacterBase enemy)
|
||||
{
|
||||
Debug.Log("enemyGETHIT");
|
||||
|
||||
if (isFailed || isCompleted) return;
|
||||
|
||||
// TODO: 에너미 피격 효과음
|
||||
|
8
Assets/KSH/ReDungeon.meta
Normal file
8
Assets/KSH/ReDungeon.meta
Normal file
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4193e9c8c0cfacb48ac9b3d855367a0c
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
BIN
Assets/KSH/ReDungeon.unity
(Stored with Git LFS)
Normal file
BIN
Assets/KSH/ReDungeon.unity
(Stored with Git LFS)
Normal file
Binary file not shown.
7
Assets/KSH/ReDungeon.unity.meta
Normal file
7
Assets/KSH/ReDungeon.unity.meta
Normal file
@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b7412a4a2ee433447afcb28700cb50a9
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
BIN
Assets/KSH/ReDungeon/NavMesh-Ground.asset
Normal file
BIN
Assets/KSH/ReDungeon/NavMesh-Ground.asset
Normal file
Binary file not shown.
8
Assets/KSH/ReDungeon/NavMesh-Ground.asset.meta
Normal file
8
Assets/KSH/ReDungeon/NavMesh-Ground.asset.meta
Normal file
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 75d6602e946891641821809218b5ccb8
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 23800000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
BIN
Assets/KSH/ReHousing.unity
(Stored with Git LFS)
BIN
Assets/KSH/ReHousing.unity
(Stored with Git LFS)
Binary file not shown.
@ -66,12 +66,14 @@ public partial class GameManager : Singleton<GameManager>
|
||||
|
||||
public void ChangeToGameScene()
|
||||
{
|
||||
SceneManager.LoadScene("DungeonTestScene"); // 던전 Scene
|
||||
SceneManager.LoadScene("ReDungeon"); // 던전 Scene
|
||||
HandleSceneAudio("Dungeon");
|
||||
}
|
||||
|
||||
public void ChangeToHomeScene()
|
||||
{
|
||||
SceneManager.LoadScene("ReHousing"); // Home Scene
|
||||
HandleSceneAudio("Housing");
|
||||
}
|
||||
|
||||
// TODO: Open Setting Panel 등 Panel 처리
|
||||
|
@ -154,7 +154,7 @@ public partial class GameManager
|
||||
{
|
||||
targetScene = "Housing";
|
||||
}
|
||||
else if (sceneName.Contains("Game"))
|
||||
else if (sceneName.Contains("Dungeon"))
|
||||
{
|
||||
targetScene = "Game";
|
||||
}
|
||||
|
@ -23,7 +23,7 @@ public class SoundManager : Singleton<SoundManager>
|
||||
// 페이드 효과 진행 여부
|
||||
private bool isFading = false;
|
||||
|
||||
private void Awake()
|
||||
private void Start()
|
||||
{
|
||||
InitializeAudioSources();
|
||||
}
|
||||
|
@ -9,6 +9,6 @@ EditorBuildSettings:
|
||||
path: Assets/KSH/ReHousing.unity
|
||||
guid: b748e35b920bde64cbd6ffe5fdb43e23
|
||||
- enabled: 1
|
||||
path: Assets/KSH/DungeonTestScene.unity
|
||||
guid: 4563b107911b0e54cbdf659694a6f17a
|
||||
path: Assets/KSH/ReDungeon.unity
|
||||
guid: b7412a4a2ee433447afcb28700cb50a9
|
||||
m_configObjects: {}
|
||||
|
Loading…
x
Reference in New Issue
Block a user