fix
This commit is contained in:
parent
0d8002bf65
commit
bfcc1b5fd6
@ -32,7 +32,7 @@ namespace AlicizaX.Scene.Runtime
|
|||||||
|
|
||||||
if (sceneMode == LoadSceneMode.Additive)
|
if (sceneMode == LoadSceneMode.Additive)
|
||||||
{
|
{
|
||||||
if (sceneState.TryGetSubScene(location, out SceneHandle loadedSubScene))
|
if (sceneState.TryGetSubScene(location, out YooAsset.SceneHandle loadedSubScene))
|
||||||
{
|
{
|
||||||
throw new Exception($"Could not load subScene while already loaded. Scene: {location}");
|
throw new Exception($"Could not load subScene while already loaded. Scene: {location}");
|
||||||
}
|
}
|
||||||
@ -97,7 +97,7 @@ namespace AlicizaX.Scene.Runtime
|
|||||||
|
|
||||||
if (sceneMode == LoadSceneMode.Additive)
|
if (sceneMode == LoadSceneMode.Additive)
|
||||||
{
|
{
|
||||||
if (sceneState.TryGetSubScene(location, out SceneHandle loadedSubScene))
|
if (sceneState.TryGetSubScene(location, out YooAsset.SceneHandle loadedSubScene))
|
||||||
{
|
{
|
||||||
Log.Warning($"Could not load subScene while already loaded. Scene: {location}");
|
Log.Warning($"Could not load subScene while already loaded. Scene: {location}");
|
||||||
return;
|
return;
|
||||||
@ -306,7 +306,7 @@ namespace AlicizaX.Scene.Runtime
|
|||||||
return sceneState;
|
return sceneState;
|
||||||
}
|
}
|
||||||
|
|
||||||
private async UniTaskVoid InvokeSceneProgress(SceneHandle sceneHandle, Action<float> progress)
|
private async UniTaskVoid InvokeSceneProgress(YooAsset.SceneHandle sceneHandle, Action<float> progress)
|
||||||
{
|
{
|
||||||
if (sceneHandle == null)
|
if (sceneHandle == null)
|
||||||
{
|
{
|
||||||
@ -337,12 +337,12 @@ namespace AlicizaX.Scene.Runtime
|
|||||||
|
|
||||||
internal sealed class SceneDomainStateService : ServiceBase, ISceneStateService
|
internal sealed class SceneDomainStateService : ServiceBase, ISceneStateService
|
||||||
{
|
{
|
||||||
private readonly Dictionary<string, SceneHandle> _subScenes = new Dictionary<string, SceneHandle>();
|
private readonly Dictionary<string,YooAsset.SceneHandle> _subScenes = new ();
|
||||||
private readonly HashSet<string> _handlingScenes = new HashSet<string>();
|
private readonly HashSet<string> _handlingScenes = new HashSet<string>();
|
||||||
|
|
||||||
public string CurrentMainSceneName { get; private set; } = string.Empty;
|
public string CurrentMainSceneName { get; private set; } = string.Empty;
|
||||||
|
|
||||||
public SceneHandle CurrentMainSceneHandle { get; private set; }
|
public YooAsset.SceneHandle CurrentMainSceneHandle { get; private set; }
|
||||||
|
|
||||||
protected override void OnInitialize()
|
protected override void OnInitialize()
|
||||||
{
|
{
|
||||||
@ -377,7 +377,7 @@ namespace AlicizaX.Scene.Runtime
|
|||||||
TryBeginHandling(sceneName);
|
TryBeginHandling(sceneName);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetMainScene(string sceneName, SceneHandle sceneHandle)
|
public void SetMainScene(string sceneName, YooAsset.SceneHandle sceneHandle)
|
||||||
{
|
{
|
||||||
CurrentMainSceneName = sceneName ?? string.Empty;
|
CurrentMainSceneName = sceneName ?? string.Empty;
|
||||||
CurrentMainSceneHandle = sceneHandle;
|
CurrentMainSceneHandle = sceneHandle;
|
||||||
@ -394,12 +394,12 @@ namespace AlicizaX.Scene.Runtime
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AddSubScene(string location, SceneHandle sceneHandle)
|
public void AddSubScene(string location, YooAsset.SceneHandle sceneHandle)
|
||||||
{
|
{
|
||||||
_subScenes[location] = sceneHandle;
|
_subScenes[location] = sceneHandle;
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool TryGetSubScene(string location, out SceneHandle sceneHandle)
|
public bool TryGetSubScene(string location, out YooAsset.SceneHandle sceneHandle)
|
||||||
=> _subScenes.TryGetValue(location, out sceneHandle);
|
=> _subScenes.TryGetValue(location, out sceneHandle);
|
||||||
|
|
||||||
public bool RemoveSubScene(string location)
|
public bool RemoveSubScene(string location)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user