mirror of
https://github.com/bdunderscore/modular-avatar.git
synced 2024-12-29 18:55:06 +08:00
fix: exceptions thrown when examining a MenuItem outside of an avatar (#1030)
This commit is contained in:
parent
8418f8e047
commit
f44e070c46
@ -123,11 +123,17 @@ namespace nadena.dev.modular_avatar.core.editor
|
||||
return;
|
||||
}
|
||||
|
||||
var parentAvatar = RuntimeUtil.FindAvatarInParents(paramRef.transform);
|
||||
if (parentAvatar == null)
|
||||
{
|
||||
_parameterSourceNotDetermined = true;
|
||||
return;
|
||||
}
|
||||
|
||||
Dictionary<string, ProvidedParameter> rootParameters = new();
|
||||
|
||||
foreach (var param in ParameterInfo.ForUI.GetParametersForObject(
|
||||
RuntimeUtil.FindAvatarInParents(paramRef.transform).gameObject
|
||||
).Where(p => p.Namespace == ParameterNamespace.Animator)
|
||||
foreach (var param in ParameterInfo.ForUI.GetParametersForObject(parentAvatar.gameObject)
|
||||
.Where(p => p.Namespace == ParameterNamespace.Animator)
|
||||
)
|
||||
rootParameters[param.EffectiveName] = param;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user