public void TakeScreenshot(ScreenshotSettings settings) { if (settings.Destination == ScreenshotSettings.OutputDestination.File) { lock (renderLockObj) { rendering = true; } Texture tex = renderContext.RenderToTexture(null, settings.Resolution); TextureLoader.Save(settings.File, settings.Format, tex); lock (renderLockObj) { rendering = false; } } }