Skip to content

Commit

Permalink
[Fix] Fixed load map method when there is no callback passed.
Browse files Browse the repository at this point in the history
  • Loading branch information
KarByc authored and lokesku committed Sep 27, 2021
1 parent 861c55d commit 19fa137
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions Assets/Scripts/Web/Loader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -779,16 +779,15 @@ public static void LoadMap(string assetGuid, string mapName, LoadSceneMode loadM

var sceneName = Path.GetFileNameWithoutExtension(scenes[0]);
var loader = SceneManager.LoadSceneAsync(sceneName, loadMode);
if (callback != null)
loader.completed += op =>
{
callback.Invoke(op.isDone, sceneName, mapBundlePath);
zip.Close();
if (textureBundle != null)
textureBundle.Unload(false);
if (mapBundle != null)
mapBundle.Unload(false);
};
loader.completed += op =>
{
callback?.Invoke(op.isDone, sceneName, mapBundlePath);
zip.Close();
if (textureBundle != null)
textureBundle.Unload(false);
if (mapBundle != null)
mapBundle.Unload(false);
};
}
catch (Exception)
{
Expand Down

0 comments on commit 19fa137

Please sign in to comment.