@@ -50,7 +50,7 @@ public static bool IsEnabled
5050 }
5151
5252 /// <summary>
53- /// Whether the dev console is open.
53+ /// Whether the dev console window is open.
5454 /// </summary>
5555 public static bool IsOpen
5656 {
@@ -68,7 +68,7 @@ public static bool IsOpen
6868 }
6969
7070 /// <summary>
71- /// Whether the dev console is open and the input field is focused.
71+ /// Whether the dev console window is open and the input field is focused.
7272 /// </summary>
7373 public static bool IsOpenAndFocused => _console . ConsoleIsShowingAndFocused ;
7474
@@ -285,6 +285,11 @@ public static void ClearConsole()
285285 /// <param name="callback"></param>
286286 public static void Register_OnDevConsoleOpened ( Action callback )
287287 {
288+ if ( callback == null )
289+ {
290+ throw new ArgumentNullException ( nameof ( callback ) ) ;
291+ }
292+
288293 _console . OnDevConsoleOpened += callback ;
289294 }
290295
@@ -294,6 +299,11 @@ public static void Register_OnDevConsoleOpened(Action callback)
294299 /// <param name="callback"></param>
295300 public static void Deregister_OnDevConsoleOpened ( Action callback )
296301 {
302+ if ( callback == null )
303+ {
304+ throw new ArgumentNullException ( nameof ( callback ) ) ;
305+ }
306+
297307 _console . OnDevConsoleOpened -= callback ;
298308 }
299309
@@ -303,6 +313,11 @@ public static void Deregister_OnDevConsoleOpened(Action callback)
303313 /// <param name="callback"></param>
304314 public static void Register_OnDevConsoleClosed ( Action callback )
305315 {
316+ if ( callback == null )
317+ {
318+ throw new ArgumentNullException ( nameof ( callback ) ) ;
319+ }
320+
306321 _console . OnDevConsoleClosed += callback ;
307322 }
308323
@@ -312,6 +327,11 @@ public static void Register_OnDevConsoleClosed(Action callback)
312327 /// <param name="callback"></param>
313328 public static void Deregister_OnDevConsoleClosed ( Action callback )
314329 {
330+ if ( callback == null )
331+ {
332+ throw new ArgumentNullException ( nameof ( callback ) ) ;
333+ }
334+
315335 _console . OnDevConsoleClosed -= callback ;
316336 }
317337
@@ -320,8 +340,7 @@ public static void Deregister_OnDevConsoleClosed(Action callback)
320340 private static void Init ( )
321341#pragma warning restore IDE0051
322342 {
323- GameObject obj = UnityEngine . Object . Instantiate ( Resources . Load < GameObject > ( "Prefabs/FAB_DevConsole.Instance" ) ) ;
324- _console = obj . GetComponent < DevConsoleMono > ( ) ;
343+ _console = UnityEngine . Object . Instantiate ( Resources . Load < GameObject > ( "Prefabs/FAB_DevConsole.Instance" ) ) . GetComponent < DevConsoleMono > ( ) ;
325344 }
326345
327346 #endregion
0 commit comments