mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
27 lines
867 B
C#
27 lines
867 B
C#
using HarmonyLib;
|
|
using NewHorizons.Handlers;
|
|
using OWML.Logging;
|
|
|
|
namespace NewHorizons.Patches
|
|
{
|
|
[HarmonyPatch]
|
|
public static class StreamingPatches
|
|
{
|
|
[HarmonyPrefix]
|
|
[HarmonyPatch(typeof(StreamingManager), nameof(StreamingManager.UnloadStreamingAssets))]
|
|
public static bool StreamingManager_UnloadStreamingAssets(string assetBundleName)
|
|
{
|
|
// Only let it unload stuff that isn't being used
|
|
return !StreamingHandler.IsBundleInUse(assetBundleName);
|
|
}
|
|
|
|
[HarmonyPrefix]
|
|
[HarmonyPatch(typeof(UnityLogger), "OnLogMessageReceived")]
|
|
public static bool UnityLogger_OnLogMessageReceived(string message)
|
|
{
|
|
// Filter out goofy error that doesn't actually break anything
|
|
return !message.EndsWith(" is out of bounds (size=0)");
|
|
}
|
|
}
|
|
}
|