private void OnDisable() { if (!UseVrDevice || _compositor != null) { var vrStats = new Compositor_CumulativeStats(); if (_compositor != null) { _compositor.GetCumulativeStats(ref vrStats, (uint)Marshal.SizeOf(typeof(Compositor_CumulativeStats))); } } StopAllCoroutines(); _mediaSession = null; _mediaCollection = null; Native.Media.Release(); Native.Graphic.Release(); print("Object Disabled"); if (_toAnotherScene) { return; } #if UNITY_EDITOR EditorApplication.isPlaying = false; #else Application.Quit(); #endif }