변수명 수정
This commit is contained in:
parent
669ddf3305
commit
6bfd22161c
@ -1,4 +1,3 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
@ -44,17 +43,17 @@ public async Task Init()
|
|||||||
#if UNITY_EDITOR
|
#if UNITY_EDITOR
|
||||||
var flowToSceneMapping = GameFlowManager.Instance.GameFlowSceneMappingSo.FlowToSceneMapping;
|
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;
|
if (editorAsset == null) continue;
|
||||||
|
|
||||||
var path = AssetDatabase.GetAssetPath(editorAsset);
|
var path = AssetDatabase.GetAssetPath(editorAsset);
|
||||||
if (string.IsNullOrWhiteSpace(path) == false && path == activeScene.path)
|
if (string.IsNullOrWhiteSpace(path) == false && path == activeScene.path)
|
||||||
{
|
{
|
||||||
var data = new SceneData(activeScene, null);
|
var data = new SceneData(activeScene, null);
|
||||||
_loadedSceneDatas[pair.Key] = data;
|
_loadedSceneDatas[flowAssetPair.Key] = data;
|
||||||
_assetKeyToSceneData[GetRuntimeKey(pair.Value)] = data;
|
_assetKeyToSceneData[GetRuntimeKey(flowAssetPair.Value)] = data;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -105,27 +104,27 @@ public async Task PreloadAll()
|
|||||||
{
|
{
|
||||||
var flowToSceneMapping = GameFlowManager.Instance.GameFlowSceneMappingSo.FlowToSceneMapping;
|
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))
|
if (_assetKeyToSceneData.TryGetValue(runtimeKey, out var existing))
|
||||||
{
|
{
|
||||||
_loadedSceneDatas[pair.Key] = existing;
|
_loadedSceneDatas[flowAssetPair.Key] = existing;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
var instance = await AssetManager.LoadScene(pair.Value);
|
var instance = await AssetManager.LoadScene(flowAssetPair.Value);
|
||||||
if (!instance.Scene.IsValid())
|
if (!instance.Scene.IsValid())
|
||||||
{
|
{
|
||||||
Debug.LogError($"[SceneManager] {pair.Key}의 씬 로딩 실패");
|
Debug.LogError($"[SceneManager] {flowAssetPair.Key}의 씬 로딩 실패");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
DeactivateScene(instance.Scene);
|
DeactivateScene(instance.Scene);
|
||||||
var data = new SceneData(instance.Scene, instance);
|
var data = new SceneData(instance.Scene, instance);
|
||||||
_loadedSceneDatas[pair.Key] = data;
|
_loadedSceneDatas[flowAssetPair.Key] = data;
|
||||||
_assetKeyToSceneData[runtimeKey] = data;
|
_assetKeyToSceneData[runtimeKey] = data;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -180,9 +179,9 @@ public void DeactivateScene(GameFlowState gameFlowState)
|
|||||||
|
|
||||||
private void DeactivateScene(Scene scene)
|
private void DeactivateScene(Scene scene)
|
||||||
{
|
{
|
||||||
foreach (var root in scene.GetRootGameObjects())
|
foreach (var rootObject in scene.GetRootGameObjects())
|
||||||
{
|
{
|
||||||
root.SetActive(false);
|
rootObject.SetActive(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user