diff --git a/Runtime/SkyHookManager.cs b/Runtime/SkyHookManager.cs index c0b1f1d..73b6a18 100644 --- a/Runtime/SkyHookManager.cs +++ b/Runtime/SkyHookManager.cs @@ -41,12 +41,15 @@ namespace SkyHook /// /// The instance of . /// A new instance will be created if it does not exist. + ///
+ /// This will return null if is false. ///
// ReSharper disable once MemberCanBePrivate.Global public static SkyHookManager Instance { get { + if (!Application.isPlaying) return null; if (_instance) return _instance; var obj = new GameObject("SkyHook Manager"); @@ -119,17 +122,33 @@ namespace SkyHook /// /// Starts the native hook. + ///
+ /// This will only work if is true. ///
public static void StartHook() { + if (!Application.isPlaying) + { + Debug.LogWarning("You may not call StartHook() if the application is not playing."); + return; + } + Instance._StartHook(); } /// /// Stops the native hook. + ///
+ /// This will only work if is true. ///
public static void StopHook() { + if (!Application.isPlaying) + { + Debug.LogWarning("You may not call StopHook() if the application is not playing."); + return; + } + Instance._StopHook(); }