mirror of
https://github.com/bdunderscore/modular-avatar.git
synced 2024-12-29 18:55:06 +08:00
fix: NRE issued when viewing Menu Item editor outside of an avatar
This commit is contained in:
parent
cb2afcc3d5
commit
f85d455c8f
@ -646,6 +646,9 @@ namespace nadena.dev.modular_avatar.core.editor
|
||||
var myMenuItem = serializedObject.targetObject as ModularAvatarMenuItem;
|
||||
if (myMenuItem == null) return null;
|
||||
|
||||
var avatarRoot = RuntimeUtil.FindAvatarInParents(myMenuItem.gameObject.transform);
|
||||
if (avatarRoot == null) return null;
|
||||
|
||||
var myParameterName = myMenuItem.Control.parameter.name;
|
||||
if (string.IsNullOrEmpty(myParameterName)) return new List<ModularAvatarMenuItem>();
|
||||
|
||||
@ -653,7 +656,6 @@ namespace nadena.dev.modular_avatar.core.editor
|
||||
if (myMappings.TryGetValue((ParameterNamespace.Animator, myParameterName), out var myReplacement))
|
||||
myParameterName = myReplacement.ParameterName;
|
||||
|
||||
var avatarRoot = RuntimeUtil.FindAvatarInParents(myMenuItem.gameObject.transform);
|
||||
var siblings = new List<ModularAvatarMenuItem>();
|
||||
|
||||
foreach (var otherMenuItem in avatarRoot.GetComponentsInChildren<ModularAvatarMenuItem>(true))
|
||||
|
Loading…
Reference in New Issue
Block a user