mirror of
https://github.com/bdunderscore/modular-avatar.git
synced 2024-12-28 10:15:06 +08:00
Fixes error when merging same parameter with different type in RC menu item (#1313)
This commit is contained in:
parent
131f54a713
commit
07b648dcc1
@ -3,6 +3,8 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using nadena.dev.ndmf;
|
||||
using UnityEngine;
|
||||
using UnityEditor.Animations;
|
||||
using VRC.SDK3.Avatars.Components;
|
||||
using VRC.SDK3.Avatars.ScriptableObjects;
|
||||
|
||||
namespace nadena.dev.modular_avatar.core.editor
|
||||
@ -186,6 +188,22 @@ namespace nadena.dev.modular_avatar.core.editor
|
||||
|
||||
expParams.parameters = expParams.parameters.Concat(newParameters.Values).ToArray();
|
||||
}
|
||||
|
||||
if (_mamiByParam.Count > 0)
|
||||
{
|
||||
// This make sures the parameters are correctly merged into the FX layer.
|
||||
var mergeAnimator = context.AvatarRootObject.AddComponent<ModularAvatarMergeAnimator>();
|
||||
mergeAnimator.layerType = VRCAvatarDescriptor.AnimLayerType.FX;
|
||||
mergeAnimator.deleteAttachedAnimator = false;
|
||||
mergeAnimator.animator = new AnimatorController
|
||||
{
|
||||
parameters = _mamiByParam.Keys.Select(name => new AnimatorControllerParameter
|
||||
{
|
||||
name = name,
|
||||
type = AnimatorControllerParameterType.Float,
|
||||
}).ToArray(),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
internal static ControlCondition AssignMenuItemParameter(
|
||||
|
Loading…
Reference in New Issue
Block a user