/// <summary> /// Unregister a MagicLeap API from being called when OnDestroy for this behavior is called. /// </summary> /// <param name="callback">Callback to register.</param> public static void UnregisterDestroy(OnDestroyEventDelegate callback) { // Check instance instead of the Instance property to prevent // creating an instance to unregister something that won't be there. if (instance != null) { instance.OnDestroyEvent -= callback; } }
/// <summary> /// Register a MagicLeap API Update callback to be called on Destroy of this behavior. /// </summary> /// <param name="callback">Callback to register.</param> public static void RegisterDestroy(OnDestroyEventDelegate callback) { Instance.OnDestroyEvent += callback; }