mirror of
https://github.com/bdunderscore/modular-avatar.git
synced 2025-01-04 13:45:04 +08:00
ddbc3b164b
* chore: rearrange package structure to have the package at the root * ci: update CI workflows * ci: fixing workflow bugs * ci: recurse building .zip package * ci: more fixes * ci: add back in the nadena.dev VPM repo * ci: fix tests
46 lines
1.5 KiB
C#
46 lines
1.5 KiB
C#
using nadena.dev.modular_avatar.core.editor;
|
|
using NUnit.Framework;
|
|
using VRC.SDK3.Dynamics.PhysBone.Components;
|
|
|
|
namespace modular_avatar_tests.DuplicatePBStripping
|
|
{
|
|
public class DuplicatePBStripping : TestBase
|
|
{
|
|
[Test]
|
|
public void StripsExtraPBones_withNullRootTransform()
|
|
{
|
|
var prefab = CreatePrefab("DuplicatePBStripping_nullRef.prefab");
|
|
AvatarProcessor.ProcessAvatar(prefab);
|
|
|
|
Assert.AreEqual(1, prefab.GetComponentsInChildren<VRCPhysBone>().Length);
|
|
}
|
|
|
|
[Test]
|
|
public void StripsExtraPBones_withExplicitRootTransform()
|
|
{
|
|
var prefab = CreatePrefab("DuplicatePBStripping_objRef.prefab");
|
|
AvatarProcessor.ProcessAvatar(prefab);
|
|
|
|
Assert.AreEqual(1, prefab.GetComponentsInChildren<VRCPhysBone>().Length);
|
|
}
|
|
|
|
[Test]
|
|
public void StripsExtraPBones_withSiblingRootTransform()
|
|
{
|
|
var prefab = CreatePrefab("DuplicatePBStripping_otherRef.prefab");
|
|
AvatarProcessor.ProcessAvatar(prefab);
|
|
|
|
Assert.AreEqual(1, prefab.GetComponentsInChildren<VRCPhysBone>().Length);
|
|
}
|
|
|
|
[Test]
|
|
public void StripsExtraPBones_notWhenTargetDiffers()
|
|
{
|
|
var prefab = CreatePrefab("DuplicatePBStripping_preserve.prefab");
|
|
AvatarProcessor.ProcessAvatar(prefab);
|
|
|
|
// Note that this prefab has one duplicate, one non-duplicate component
|
|
Assert.AreEqual(2, prefab.GetComponentsInChildren<VRCPhysBone>().Length);
|
|
}
|
|
}
|
|
} |