Skip to content

Commit 19fa137

Browse files
KarByclokesku
authored andcommitted
[Fix] Fixed load map method when there is no callback passed.
1 parent 861c55d commit 19fa137

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

Assets/Scripts/Web/Loader.cs

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -779,16 +779,15 @@ public static void LoadMap(string assetGuid, string mapName, LoadSceneMode loadM
779779

780780
var sceneName = Path.GetFileNameWithoutExtension(scenes[0]);
781781
var loader = SceneManager.LoadSceneAsync(sceneName, loadMode);
782-
if (callback != null)
783-
loader.completed += op =>
784-
{
785-
callback.Invoke(op.isDone, sceneName, mapBundlePath);
786-
zip.Close();
787-
if (textureBundle != null)
788-
textureBundle.Unload(false);
789-
if (mapBundle != null)
790-
mapBundle.Unload(false);
791-
};
782+
loader.completed += op =>
783+
{
784+
callback?.Invoke(op.isDone, sceneName, mapBundlePath);
785+
zip.Close();
786+
if (textureBundle != null)
787+
textureBundle.Unload(false);
788+
if (mapBundle != null)
789+
mapBundle.Unload(false);
790+
};
792791
}
793792
catch (Exception)
794793
{

0 commit comments

Comments
 (0)