From 5963edd9b505f80a38d8e4768f2c24c16b752c40 Mon Sep 17 00:00:00 2001 From: msk <15199219+muskit@users.noreply.github.com> Date: Wed, 25 May 2022 15:04:33 -0700 Subject: [PATCH] Update SkyboxSwitcher.cs --- Assets/Script/SkyboxSwitcher.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Assets/Script/SkyboxSwitcher.cs b/Assets/Script/SkyboxSwitcher.cs index 528e033..e6e395c 100644 --- a/Assets/Script/SkyboxSwitcher.cs +++ b/Assets/Script/SkyboxSwitcher.cs @@ -42,6 +42,7 @@ public class SkyboxSwitcher : MonoBehaviour private void SetSkybox() { counterTxt.text = (currentSkyboxIndex + 1).ToString(); - RenderSettings.skybox = skyboxes[currentSkyboxIndex]; + if (skyboxes[currentSkyboxIndex] != null) + RenderSettings.skybox = skyboxes[currentSkyboxIndex]; } }