Skip to content

Commit 714b1d1

Browse files
committed
Configurable Enter Play Mode is supported (disabling Domain Reload works but disabling Scene Reload isn't tested)
1 parent 7052af1 commit 714b1d1

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

Plugins/IngameDebugConsole/IngameDebugConsole.Runtime.asmdef

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
"name": "IngameDebugConsole.Runtime",
33
"rootNamespace": "",
44
"references": [
5-
"Unity.InputSystem"
5+
"Unity.InputSystem",
6+
"Unity.TextMeshPro"
67
],
78
"includePlatforms": [],
89
"excludePlatforms": [],

Plugins/IngameDebugConsole/Scripts/DebugLogConsole.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,12 @@ public static class DebugLogConsole
122122
// CompareInfo used for case-insensitive command name comparison
123123
internal static readonly CompareInfo caseInsensitiveComparer = new CultureInfo( "en-US" ).CompareInfo;
124124

125-
static DebugLogConsole()
125+
[RuntimeInitializeOnLoadMethod( RuntimeInitializeLoadType.SubsystemRegistration )] // Configurable Enter Play Mode: https://docs.unity3d.com/Manual/DomainReloading.html
126+
private static void ResetStatics()
126127
{
128+
methods.Clear();
129+
OnCommandExecuted = null;
130+
127131
#if !IDG_DISABLE_HELP_COMMAND
128132
AddCommand( "help", "Prints all commands", LogAllCommands );
129133
AddCommand<string>( "help", "Prints all matching commands", LogAllCommandsWithName );

0 commit comments

Comments
 (0)