public void OnDisable() { WebCamTexture target = base.target as WebCamTexture; if (!Application.isPlaying && (target != null)) { target.Stop(); } }