public void Start() { if (UnityARSessionNativeInterface.IsARKitRemoteServer()) { UnityARSessionNativeInterface.ARFrameUpdatedEvent += UpdateFrame; } bCommandBufferInitialized = false; }
void OnDestroy() { if (m_VideoCommandBuffer != null) { GetComponent <Camera>().RemoveCommandBuffer(CameraEvent.BeforeForwardOpaque, m_VideoCommandBuffer); } if (UnityARSessionNativeInterface.IsARKitRemoteServer()) { UnityARSessionNativeInterface.ARFrameUpdatedEvent -= UpdateFrame; } bCommandBufferInitialized = false; if (_videoTextureY) { Destroy(_videoTextureY); } if (_videoTextureCbCr) { Destroy(_videoTextureCbCr); } }