diff --git a/Facepunch.Steamworks/Utility/SteamInterface.cs b/Facepunch.Steamworks/Utility/SteamInterface.cs index d9d10ba..2ead970 100644 --- a/Facepunch.Steamworks/Utility/SteamInterface.cs +++ b/Facepunch.Steamworks/Utility/SteamInterface.cs @@ -31,6 +31,7 @@ public void Init() return; } + PreservationHack(); throw new System.Exception( "Trying to initialize Steam Interface but Steam not initialized" ); } @@ -109,5 +110,15 @@ internal virtual void Shutdown() } public abstract void InitInternals(); + + internal void PreservationHack() + { + // + // Stop Utf8StringToNative.GetInstance getting culled by stuff like Unity's + // asselmbly optimization stuff. Here we just call it so it can't not exist. + // + var i = Utf8StringToNative.GetInstance( "don't cull this function" ); + i.GetNativeDataSize(); + } } } \ No newline at end of file