mirror of
https://github.com/bdunderscore/modular-avatar.git
synced 2025-04-04 19:49:02 +08:00
fix: state machine behaviors are not renamed
This commit is contained in:
parent
4d5c01afae
commit
893442c705
@ -6,14 +6,12 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Immutable;
|
||||
using System.Linq;
|
||||
using nadena.dev.modular_avatar.animation;
|
||||
using nadena.dev.modular_avatar.editor.ErrorReporting;
|
||||
using nadena.dev.ndmf;
|
||||
using nadena.dev.ndmf.animator;
|
||||
using UnityEditor;
|
||||
using UnityEditor.Animations;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Profiling;
|
||||
using VRC.SDK3.Avatars.Components;
|
||||
using VRC.SDK3.Avatars.ScriptableObjects;
|
||||
using VRC.SDK3.Dynamics.Contact.Components;
|
||||
@ -570,6 +568,7 @@ namespace nadena.dev.modular_avatar.core.editor
|
||||
{
|
||||
switch (node)
|
||||
{
|
||||
case VirtualStateMachine vsm: ProcessStateMachine(vsm, remap); break;
|
||||
case VirtualState vs: ProcessState(vs, remap); break;
|
||||
case VirtualTransition vt: ProcessTransition(vt, remap); break;
|
||||
case VirtualClip vc: ProcessClip(vc, remap); break;
|
||||
@ -594,6 +593,18 @@ namespace nadena.dev.modular_avatar.core.editor
|
||||
controller.Parameters = newParameters;
|
||||
}
|
||||
|
||||
private void ProcessStateMachine(VirtualStateMachine vsm,
|
||||
ImmutableDictionary<(ParameterNamespace, string), ParameterMapping> remaps)
|
||||
{
|
||||
foreach (var behavior in vsm.Behaviours)
|
||||
{
|
||||
if (behavior is VRCAvatarParameterDriver driver)
|
||||
{
|
||||
ProcessDriver(driver, remaps);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void ProcessState(VirtualState state, ImmutableDictionary<(ParameterNamespace, string), ParameterMapping> remaps)
|
||||
{
|
||||
state.MirrorParameter = remap(remaps, state.MirrorParameter);
|
||||
|
Loading…
x
Reference in New Issue
Block a user