public IEnumerator RenderImageAndClose(bool Props, bool Decals, int Width, int Height, string MapPath, string ImagePath) { var LoadScmapFile = MapLuaParser.Current.StartCoroutine(ForceLoadMapAtPath(MapPath, Props, Decals)); yield return(LoadScmapFile); QualitySettings.lodBias = 100000; QualitySettings.shadowDistance = CameraControler.Current.transform.localPosition.y * 1.1f; if (Decals) { OzoneDecals.OzoneDecalRenderer.CutoffMultiplier = 100000; } CameraControler.Current.RestartCam(true); yield return(null); CameraControler.Current.RenderCamera(Width, Height, ImagePath); //ScmapEditor.Current.PreviewRenderer.RenderPreview() if (Decals) { OzoneDecals.OzoneDecalRenderer.CutoffMultiplier = 1; } Debug.Log("Success! Preview rendered to: " + ImagePath); OnFafEditorQuit.ForceQuit(); }
private void Awake() { Current = this; Application.wantsToQuit += WantsToQuit; }