From 301bd031207050e8bcadd109cd4f283b40d4a9d7 Mon Sep 17 00:00:00 2001 From: recharge-sp Date: Tue, 24 Sep 2024 22:54:52 +0800 Subject: [PATCH] Gameplay: Fix Video Player being active while advanced graphics is disabled --- Assets/Scripts/Gameplay/Skin/SkinService.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Assets/Scripts/Gameplay/Skin/SkinService.cs b/Assets/Scripts/Gameplay/Skin/SkinService.cs index 67a6c135..5cdc1d5f 100644 --- a/Assets/Scripts/Gameplay/Skin/SkinService.cs +++ b/Assets/Scripts/Gameplay/Skin/SkinService.cs @@ -374,10 +374,11 @@ public void ApplyRedArcValue(int color, float value) public void SetVideoBackground(string path, bool isUri) { - videoBackground.enabled = !string.IsNullOrEmpty(path); - videoBackgroundRenderer.enabled = !string.IsNullOrEmpty(path) && !Settings.DisableAdvancedGraphics.Value; + bool enabled = !string.IsNullOrEmpty(path) && !Settings.DisableAdvancedGraphics.Value; + videoBackground.enabled = enabled; + videoBackgroundRenderer.enabled = enabled; - if (!string.IsNullOrEmpty(path)) + if (enabled) { path = isUri ? Uri.EscapeUriString(path.Replace("\\", "/")) : path.Replace("\\", "/"); videoBackground.url = isUri ? path : "file://" + path;