From 3da86f1776131ebbaae759c234aa0dc1cc1927ec Mon Sep 17 00:00:00 2001 From: kafeijao Date: Fri, 11 Apr 2025 15:34:45 +0100 Subject: [PATCH] add support for Unity versions earlier than 2022 --- Editor/LTCGI_Controller.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Editor/LTCGI_Controller.cs b/Editor/LTCGI_Controller.cs index affa12b..7f41bde 100644 --- a/Editor/LTCGI_Controller.cs +++ b/Editor/LTCGI_Controller.cs @@ -148,7 +148,11 @@ public void UpdateMaterials(bool fast, LTCGI_Screen screen = null) return; if (Lightmapping.isRunning) return; - if (UnityEngine.SceneManagement.SceneManager.loadedSceneCount == 0) + #if UNITY_2022_1_OR_NEWER + if (UnityEngine.SceneManagement.SceneManager.loadedSceneCount == 0) + #else + if (UnityEditor.SceneManagement.EditorSceneManager.loadedSceneCount == 0) + #endif return; #if DEBUG_LOG