Skip to content

Commit

Permalink
fix: SpriteManager Race Conditions BZ (#452)
Browse files Browse the repository at this point in the history
* Fixed SpriteManager race conditions

* Removed redundant usings

* Why did I remove this lol
  • Loading branch information
Metious committed Aug 31, 2023
1 parent ce7a814 commit f04d892
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Nautilus/Initializer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
using Nautilus.Patchers;
using Nautilus.Utility;
using UnityEngine;
#if BELOWZERO
using UnityEngine.U2D;
#endif

namespace Nautilus;

Expand All @@ -16,6 +19,16 @@ public class Initializer : BaseUnityPlugin
{
private static readonly Harmony _harmony = new(PluginInfo.PLUGIN_GUID);

#if BELOWZERO
static Initializer()
{
var handle = AddressablesUtility.LoadAllAsync<SpriteAtlas>("SpriteAtlases");
handle.Completed += SpriteManager.OnLoadedSpriteAtlases;
// Please dont use this method. I hate using it but we have no other choice.
_ = handle.WaitForCompletion();
}
#endif

/// <summary>
/// WARNING: This method is for use only by BepInEx.
/// </summary>
Expand Down

0 comments on commit f04d892

Please sign in to comment.