diff --git a/com.rlabrecque.steamworks.net/Editor/RedistInstall.cs b/com.rlabrecque.steamworks.net/Editor/RedistInstall.cs index 8e02ecec..09a38842 100644 --- a/com.rlabrecque.steamworks.net/Editor/RedistInstall.cs +++ b/com.rlabrecque.steamworks.net/Editor/RedistInstall.cs @@ -10,10 +10,30 @@ // This copies various files into their required locations when Unity is launched to make installation a breeze. [InitializeOnLoad] public class RedistInstall { + + const string STEAMWORKS_AUTOFIX_DISABLED_MENU_ITEM = "Steamworks.NET/Disable Autofix"; + const string STEAMWORKS_AUTOFIX_DISABLED = "STEAMWORKS_AUTOFIX_DISABLED"; + + [MenuItem(STEAMWORKS_AUTOFIX_DISABLED_MENU_ITEM)] + static void SwitchAutofixDisabled() { + var autofixDisabled = !IsAutofixDisabled(); + EditorPrefs.SetBool(STEAMWORKS_AUTOFIX_DISABLED, autofixDisabled); + UpdateMenuItems(); + } + + static bool IsAutofixDisabled(){ + return EditorPrefs.GetBool(STEAMWORKS_AUTOFIX_DISABLED, true); + } + + static void UpdateMenuItems() { + Menu.SetChecked(STEAMWORKS_AUTOFIX_DISABLED_MENU_ITEM, IsAutofixDisabled()); + } + static RedistInstall() { WriteSteamAppIdTxtFile(); AddDefineSymbols(); CheckForOldDlls(); + UpdateMenuItems(); } static void WriteSteamAppIdTxtFile() { @@ -57,6 +77,9 @@ static void CheckForOldDlls() { } static void AddDefineSymbols() { + if (IsAutofixDisabled()) + return; + string currentDefines = PlayerSettings.GetScriptingDefineSymbolsForGroup(EditorUserBuildSettings.selectedBuildTargetGroup); HashSet defines = new HashSet(currentDefines.Split(';')) { "STEAMWORKS_NET" diff --git a/com.rlabrecque.steamworks.net/Runtime/autogen/isteamclient.cs b/com.rlabrecque.steamworks.net/Runtime/autogen/isteamclient.cs index 58b69ef7..ebcd4c13 100644 --- a/com.rlabrecque.steamworks.net/Runtime/autogen/isteamclient.cs +++ b/com.rlabrecque.steamworks.net/Runtime/autogen/isteamclient.cs @@ -228,6 +228,7 @@ public static uint GetIPCCallCount() { /// 'const char *' is the text of the message /// callbacks will occur directly after the API function is called that generated the warning or message. /// + [AOT.MonoPInvokeCallback(typeof(SteamAPIWarningMessageHook_t))] public static void SetWarningMessageHook(SteamAPIWarningMessageHook_t pFunction) { InteropHelp.TestIfAvailableClient(); NativeMethods.ISteamClient_SetWarningMessageHook(CSteamAPIContext.GetSteamClient(), pFunction);