DDD-32 게임 플로우 매니저 및 씬 매니저 구현 #4

Merged
iwnc2020 merged 3 commits from global_data_system into develop 2025-07-14 02:04:58 +00:00
2 changed files with 5 additions and 11 deletions
Showing only changes of commit b83e4c3a5e - Show all commits

View File

@ -2,6 +2,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Threading.Tasks; using System.Threading.Tasks;
using UnityEngine; using UnityEngine;
using UnityEngine.ResourceManagement.ResourceProviders;
using UnityEngine.SceneManagement; using UnityEngine.SceneManagement;
namespace DDD namespace DDD
@ -27,8 +28,6 @@ public void Init()
public async void PostInit() public async void PostInit()
{ {
SceneManager.Instance.OnSceneChanged += OnFlowSceneOpened;
try try
{ {
if (IsGameStarted() == false) if (IsGameStarted() == false)
@ -109,12 +108,6 @@ public void OpenFlowScene(GameFlowState newFlowState)
} }
} }
private Scene _currentScene;
public void OnFlowSceneOpened(Scene newScene)
{
_currentScene = newScene;
}
public bool GetFlowScene(GameFlowState flowState, out SceneType sceneType) public bool GetFlowScene(GameFlowState flowState, out SceneType sceneType)
{ {
return GameFlowSceneMappingSo.FlowToSceneMapping.TryGetValue(flowState, out sceneType); return GameFlowSceneMappingSo.FlowToSceneMapping.TryGetValue(flowState, out sceneType);

View File

@ -3,7 +3,6 @@
using System.Threading.Tasks; using System.Threading.Tasks;
using UnityEngine; using UnityEngine;
using UnityEngine.ResourceManagement.ResourceProviders; using UnityEngine.ResourceManagement.ResourceProviders;
using UnityEngine.SceneManagement;
namespace DDD namespace DDD
{ {
@ -18,7 +17,9 @@ public class SceneManager : Singleton<SceneManager>, IManager
{ {
private Dictionary<SceneType, SceneInstance> _loadedScenes; private Dictionary<SceneType, SceneInstance> _loadedScenes;
public Action<Scene> OnSceneChanged; private SceneInstance _currentSceneInstance;
public Action<SceneInstance> OnSceneChanged;
public void Init() public void Init()
{ {
@ -87,7 +88,7 @@ public void ActivateScene(SceneType sceneType)
} }
UnityEngine.SceneManagement.SceneManager.SetActiveScene(sceneInstance.Scene); UnityEngine.SceneManagement.SceneManager.SetActiveScene(sceneInstance.Scene);
OnSceneChanged?.Invoke(sceneInstance.Scene); _currentSceneInstance = sceneInstance;
} }
else else
{ {