From 8ff51a970d782d267e558afe3867a73399bcb958 Mon Sep 17 00:00:00 2001 From: katboi01 <59540382+katboi01@users.noreply.github.com> Date: Sun, 22 Jan 2023 19:10:42 +0100 Subject: [PATCH] Updated Screenshot.cs Screenshot fix for animations with animated cameras --- Assets/Scripts/Screenshot.cs | 4 ++-- ProjectSettings/ProjectSettings.asset | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Assets/Scripts/Screenshot.cs b/Assets/Scripts/Screenshot.cs index e511315..897e5a2 100644 --- a/Assets/Scripts/Screenshot.cs +++ b/Assets/Scripts/Screenshot.cs @@ -19,7 +19,7 @@ public class Screenshot : MonoBehaviour public static void TakeScreenshot() { - var camera = UmaViewerBuilder.Instance.AnimationCamera.enabled ? UmaViewerBuilder.Instance.AnimationCamera : Camera.main; + var camera = UmaViewerBuilder.Instance.AnimationCamera.gameObject.activeInHierarchy ? UmaViewerBuilder.Instance.AnimationCamera : Camera.main; int width = int.Parse(UmaViewerUI.Instance.SSWidth.text); int height = int.Parse(UmaViewerUI.Instance.SSHeight.text); width = width == -1 ? Screen.width : width; @@ -46,7 +46,7 @@ public class Screenshot : MonoBehaviour private IEnumerator RecordGif(int width, int height, bool transparent, int quality) { - var camera = UmaViewerBuilder.Instance.AnimationCamera.enabled ? UmaViewerBuilder.Instance.AnimationCamera : Camera.main; + var camera = UmaViewerBuilder.Instance.AnimationCamera.gameObject.activeInHierarchy ? UmaViewerBuilder.Instance.AnimationCamera : Camera.main; var ppLayer = camera.GetComponent(); bool oldPpState = ppLayer.enabled; ppLayer.enabled = false; diff --git a/ProjectSettings/ProjectSettings.asset b/ProjectSettings/ProjectSettings.asset index 991aaa3..09f2cd0 100644 --- a/ProjectSettings/ProjectSettings.asset +++ b/ProjectSettings/ProjectSettings.asset @@ -134,7 +134,7 @@ PlayerSettings: 16:10: 1 16:9: 1 Others: 1 - bundleVersion: 2.1.5 + bundleVersion: 2.1.6 preloadedAssets: [] metroInputSource: 0 wsaTransparentSwapchain: 0