mirror of
https://github.com/bdunderscore/modular-avatar.git
synced 2024-12-29 18:55:06 +08:00
efa263b551
* feat: add version defines for VRCSDK * chore: early return if VRCSDK project but not VRChat avatar
33 lines
1.1 KiB
C#
33 lines
1.1 KiB
C#
#if MA_VRCSDK3_AVATARS_3_5_2_OR_NEWER
|
|
|
|
using nadena.dev.modular_avatar.core.editor;
|
|
using NUnit.Framework;
|
|
using UnityEditor.Animations;
|
|
using VRC.SDK3.Avatars.Components;
|
|
|
|
namespace modular_avatar_tests
|
|
{
|
|
public class PlayAudioRemapping : TestBase
|
|
{
|
|
[Test]
|
|
public void PlayAudioBehaviorsAreRemappedToCorrectPaths()
|
|
{
|
|
var prefab = CreatePrefab("PlayAudioRemapping.prefab");
|
|
AvatarProcessor.ProcessAvatar(prefab);
|
|
|
|
var fx = FindFxController(prefab);
|
|
var ac = (AnimatorController)fx.animatorController;
|
|
|
|
var layer = ac.layers[0];
|
|
var state = layer.stateMachine.states[0].state;
|
|
var playAudio = (VRCAnimatorPlayAudio) state.behaviours[0];
|
|
Assert.AreEqual("New Parent/Bone Proxy/Audio Source", playAudio.SourcePath);
|
|
|
|
var subState = layer.stateMachine.stateMachines[0].stateMachine.states[0].state;
|
|
var playAudio2 = (VRCAnimatorPlayAudio) subState.behaviours[0];
|
|
Assert.AreEqual("New Parent/Bone Proxy/Audio Source", playAudio2.SourcePath);
|
|
}
|
|
}
|
|
}
|
|
|
|
#endif |