diff --git a/Facepunch.Steamworks/Config.cs b/Facepunch.Steamworks/Config.cs index 282b3f3..565043a 100644 --- a/Facepunch.Steamworks/Config.cs +++ b/Facepunch.Steamworks/Config.cs @@ -7,6 +7,27 @@ namespace Facepunch.Steamworks { public static class Config { + /// + /// Should be called before creating any interfaces, to configure Steam for Unity. + /// + /// Please pass in Application.platform.ToString() + public static void ForUnity( string platform ) + { + // + // Windows Config + // + if ( platform == "WindowsEditor" || platform == "Windows" ) + { + // + // 32bit windows unity uses a stdcall + // + if ( IntPtr.Size == 4 ) UseThisCall = false; + + ForcePlatform( OperatingSystem.Windows, IntPtr.Size == 4 ? Architecture.x86 : Architecture.x64 ); + } + + } + /// /// Some platforms allow/need CallingConvention.ThisCall. If you're crashing with argument null /// errors on certain platforms, try flipping this to true.