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
969 B
C#
33 lines
969 B
C#
#if MA_VRCSDK3_AVATARS
|
|
|
|
using System.Linq;
|
|
using nadena.dev.ndmf;
|
|
using NUnit.Framework;
|
|
using UnityEditor.Animations;
|
|
using VRC.SDK3.Avatars.Components;
|
|
|
|
namespace modular_avatar_tests
|
|
{
|
|
public class BaseLayerReferenceCorrectionTest : TestBase
|
|
{
|
|
[Test]
|
|
public void whenBaseAnimatorLayersAreDeleted_layerCrossRefsAreCorrected()
|
|
{
|
|
var avatar = CreatePrefab("BaseLayerReferenceCorrection.prefab");
|
|
|
|
AvatarProcessor.ProcessAvatar(avatar);
|
|
|
|
var fx = findFxLayer(avatar, "test");
|
|
var state = fx.stateMachine.defaultState;
|
|
var alc = state.behaviours[0] as VRCAnimatorLayerControl;
|
|
Assert.NotNull(alc);
|
|
|
|
var desiredIndex = ((AnimatorController)FindFxController(avatar).animatorController)
|
|
.layers.TakeWhile(l => l.name != "l1").Count();
|
|
|
|
Assert.AreEqual(desiredIndex, alc.layer);
|
|
}
|
|
}
|
|
}
|
|
|
|
#endif |