From 6bfd22161cb21a344028e2ffad9d96d1ff0a33da Mon Sep 17 00:00:00 2001 From: NTG_Lenovo Date: Tue, 5 Aug 2025 12:08:13 +0900 Subject: [PATCH] =?UTF-8?q?=EB=B3=80=EC=88=98=EB=AA=85=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../GameFramework/Scene/SceneManager.cs | 27 +++++++++---------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/Assets/_DDD/_Scripts/GameFramework/Scene/SceneManager.cs b/Assets/_DDD/_Scripts/GameFramework/Scene/SceneManager.cs index 5deb51d14..0bcfca570 100644 --- a/Assets/_DDD/_Scripts/GameFramework/Scene/SceneManager.cs +++ b/Assets/_DDD/_Scripts/GameFramework/Scene/SceneManager.cs @@ -1,4 +1,3 @@ -using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; @@ -44,17 +43,17 @@ public async Task Init() #if UNITY_EDITOR var flowToSceneMapping = GameFlowManager.Instance.GameFlowSceneMappingSo.FlowToSceneMapping; - foreach (var pair in flowToSceneMapping) + foreach (var flowAssetPair in flowToSceneMapping) { - var editorAsset = pair.Value.editorAsset; + var editorAsset = flowAssetPair.Value.editorAsset; if (editorAsset == null) continue; var path = AssetDatabase.GetAssetPath(editorAsset); if (string.IsNullOrWhiteSpace(path) == false && path == activeScene.path) { var data = new SceneData(activeScene, null); - _loadedSceneDatas[pair.Key] = data; - _assetKeyToSceneData[GetRuntimeKey(pair.Value)] = data; + _loadedSceneDatas[flowAssetPair.Key] = data; + _assetKeyToSceneData[GetRuntimeKey(flowAssetPair.Value)] = data; break; } } @@ -105,27 +104,27 @@ public async Task PreloadAll() { var flowToSceneMapping = GameFlowManager.Instance.GameFlowSceneMappingSo.FlowToSceneMapping; - foreach (var pair in flowToSceneMapping) + foreach (var flowAssetPair in flowToSceneMapping) { - if (_loadedSceneDatas.ContainsKey(pair.Key)) continue; + if (_loadedSceneDatas.ContainsKey(flowAssetPair.Key)) continue; - var runtimeKey = GetRuntimeKey(pair.Value); + var runtimeKey = GetRuntimeKey(flowAssetPair.Value); if (_assetKeyToSceneData.TryGetValue(runtimeKey, out var existing)) { - _loadedSceneDatas[pair.Key] = existing; + _loadedSceneDatas[flowAssetPair.Key] = existing; continue; } - var instance = await AssetManager.LoadScene(pair.Value); + var instance = await AssetManager.LoadScene(flowAssetPair.Value); if (!instance.Scene.IsValid()) { - Debug.LogError($"[SceneManager] {pair.Key}의 씬 로딩 실패"); + Debug.LogError($"[SceneManager] {flowAssetPair.Key}의 씬 로딩 실패"); continue; } DeactivateScene(instance.Scene); var data = new SceneData(instance.Scene, instance); - _loadedSceneDatas[pair.Key] = data; + _loadedSceneDatas[flowAssetPair.Key] = data; _assetKeyToSceneData[runtimeKey] = data; } } @@ -180,9 +179,9 @@ public void DeactivateScene(GameFlowState gameFlowState) private void DeactivateScene(Scene scene) { - foreach (var root in scene.GetRootGameObjects()) + foreach (var rootObject in scene.GetRootGameObjects()) { - root.SetActive(false); + rootObject.SetActive(false); } }