void OnDestroy() { ARUNController controller = ARUNController.Instance; if (controller != null) { controller.OnVisionUpdate -= OnVisionUpdate; } else { //Debug.LogWarning("AureController.Instance not set"); } #if !UNITY_EDITOR if (sphero != null) { sphero.RemoveDataStreamingMask((ulong)kVisionMask); SpheroDeviceMessenger.SharedInstance.AsyncDataReceived -= ReceiveAsyncMessage; } #endif }