protected override void OnDetach() { if (renderToTexture != null) { renderToTexture.Destroy(); } base.OnDetach(); }