mirror of
https://github.com/bdunderscore/modular-avatar.git
synced 2024-12-29 18:55:06 +08:00
fix: previewing Object Toggle targets Renderers other than MeshRender… (#1112)
* fix: NullReferenceException when previewing Object Toggle with renderers other than MeshRenderer and SkinnedMeshRenderer * fix: NullReferenceException when previewing Scale Adjuster with renderers other than MeshRenderer and SkinnedMeshRenderer
This commit is contained in:
parent
2735adf55c
commit
106ba8c5ff
@ -42,6 +42,9 @@ namespace nadena.dev.modular_avatar.core.editor
|
||||
|
||||
foreach (var renderer in renderers)
|
||||
{
|
||||
// For now, the preview system only supports MeshRenderer and SkinnedMeshRenderer
|
||||
if (renderer is not MeshRenderer and not SkinnedMeshRenderer) continue;
|
||||
|
||||
bool currentlyEnabled = context.ActiveInHierarchy(renderer.gameObject);
|
||||
|
||||
bool overrideEnabled = true;
|
||||
|
@ -75,7 +75,13 @@ namespace nadena.dev.modular_avatar.core.editor
|
||||
renderers = new HashSet<Renderer>(new ObjectIdentityComparer<Renderer>());
|
||||
avatarToRenderer.Add(root, renderers);
|
||||
|
||||
foreach (var renderer in root.GetComponentsInChildren<Renderer>()) renderers.Add(renderer);
|
||||
foreach (var renderer in root.GetComponentsInChildren<Renderer>())
|
||||
{
|
||||
// For now, the preview system only supports MeshRenderer and SkinnedMeshRenderer
|
||||
if (renderer is not MeshRenderer and not SkinnedMeshRenderer) continue;
|
||||
|
||||
renderers.Add(renderer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user