fix: previewing Material Setter targets Renderers other than MeshRenderer and SkinnedMeshRenderer cause error (#1053)

This commit is contained in:
nekobako 2024-08-27 00:52:28 +09:00 committed by GitHub
parent ea857406ee
commit f9abb5c4fc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -65,6 +65,7 @@ namespace nadena.dev.modular_avatar.core.editor
{
var target = prop.TargetProp;
if (target.TargetObject is not Renderer r || r == null) continue;
if (target.TargetObject is not MeshRenderer and not SkinnedMeshRenderer) continue;
if (!target.PropertyName.StartsWith(PREFIX)) continue;
var index = int.Parse(target.PropertyName.Substring(PREFIX.Length, target.PropertyName.IndexOf(']') - PREFIX.Length));