From 9767f62e8d299f57b158a3581ef69a1d73fdc768 Mon Sep 17 00:00:00 2001 From: Kingo64 Date: Mon, 17 May 2021 22:04:27 +1000 Subject: [PATCH] Check if any LOD groups have no renderers --- ResourceChecker.cs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/ResourceChecker.cs b/ResourceChecker.cs index aa692ee..642c0fa 100755 --- a/ResourceChecker.cs +++ b/ResourceChecker.cs @@ -568,6 +568,9 @@ void ListMissing(){ SelectObject (dMissing.Object, ctrlPressed); GUILayout.Label ("missing ", GUILayout.Width(48)); switch (dMissing.type) { + case "lod": + GUI.color = new Color (defColor.r, defColor.b, 0.8f, 1.0f); + break; case "mesh": GUI.color = new Color (0.8f, 0.8f, defColor.b, 1.0f); break; @@ -854,6 +857,24 @@ void CheckResources() } } + LODGroup[] lodGroups = FindObjects(); + + // Check if any LOD groups have no renderers + foreach (var group in lodGroups) { + var lods = group.GetLODs(); + for (int i = 0, l = lods.Length; i < l; i++) { + if (lods[i].renderers.Length == 0) { + MissingGraphic tMissing = new MissingGraphic(); + tMissing.Object = group.transform; + tMissing.type = "lod"; + tMissing.name = group.transform.name; + MissingObjects.Add(tMissing); + thingsMissing = true; + } + } + } + + if (IncludeSpriteAnimations) { Animator[] animators = FindObjects();