From 943bc7a3be8ace59a96c3dfffadc2766d5f1effb Mon Sep 17 00:00:00 2001 From: Evan <81447921+xevalro@users.noreply.github.com> Date: Sat, 11 Jul 2026 20:34:10 -0500 Subject: [PATCH] Swapped deprecated functions and enums for current versions. UnityEditor.Lightmapping.giWorkflowMode is Deprecated. Auto Generated lighting is no longer supported in Unity. This check may still be important, though, as the user can tell the editor to create lightmaps automatically if they are missing. FindObjectsOfType<> is also deprecated. It still works, but the current iteration allows for specified sorting via overload arguments. --- PrefabLightmapData.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/PrefabLightmapData.cs b/PrefabLightmapData.cs index beac0b2..ea3d681 100644 --- a/PrefabLightmapData.cs +++ b/PrefabLightmapData.cs @@ -170,14 +170,16 @@ void ApplyRendererInfo(RendererInfo[] infos, int[] lightmapOffsetIndex, LightInf [UnityEditor.MenuItem("Assets/Bake Prefab Lightmaps")] static void GenerateLightmapInfo() { - if (UnityEditor.Lightmapping.giWorkflowMode != UnityEditor.Lightmapping.GIWorkflowMode.OnDemand) + Lightmapping.BakeOnSceneLoadMode mode = Lightmapping.bakeOnSceneLoad; + + if (mode == Lightmapping.BakeOnSceneLoadMode.IfMissingLightingData) { Debug.LogError("ExtractLightmapData requires that you have baked you lightmaps and Auto mode is disabled."); return; } UnityEditor.Lightmapping.Bake(); - PrefabLightmapData[] prefabs = FindObjectsOfType(); + PrefabLightmapData[] prefabs = FindObjectsByType(FindObjectsSortMode.InstanceID); foreach (var instance in prefabs) {