From 268d04ed3e41cadbaea3299c71e7c6da6f1b4001 Mon Sep 17 00:00:00 2001 From: JLChnToZ Date: Wed, 13 Nov 2024 22:19:23 +0800 Subject: [PATCH] Get rid of unit test --- .../WorldFixedObjectTest.cs | 22 +++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/UnitTests~/WorldFixedObjectTest/WorldFixedObjectTest.cs b/UnitTests~/WorldFixedObjectTest/WorldFixedObjectTest.cs index ba838bda..78314934 100644 --- a/UnitTests~/WorldFixedObjectTest/WorldFixedObjectTest.cs +++ b/UnitTests~/WorldFixedObjectTest/WorldFixedObjectTest.cs @@ -25,7 +25,16 @@ public class WorldFixedObjectTest : TestBase // fixed root is created Assert.That(fixedRoot, Is.Not.Null); - Assert.That(fixedRoot.GetComponent(), Is.Not.Null); + var avatarType = System.Type.GetType("VRC.SDKBase.VRC_AvatarDescriptor, VRCSDKBase"); + bool isVrcAvatar = false; + if (avatarType != null) + { + isVrcAvatar = avatar.GetComponent(avatarType) != null; + } + Component constraint = isVrcAvatar ? + fixedRoot.GetComponent(System.Type.GetType("VRC.SDK3.Dynamics.Constraint.Components.VRCParentConstraint, VRC.SDK3.Dynamics.Constraint")) : + fixedRoot.GetComponent(); + Assert.That(constraint, Is.Not.Null); // objects are moved to fixed root Assert.That(movedFixedObject, Is.Not.Null); @@ -52,7 +61,16 @@ public class WorldFixedObjectTest : TestBase // fixed root is created Assert.That(fixedRoot, Is.Not.Null); - Assert.That(fixedRoot.GetComponent(), Is.Not.Null); + var avatarType = System.Type.GetType("VRC.SDKBase.VRC_AvatarDescriptor, VRCSDKBase"); + bool isVrcAvatar = false; + if (avatarType != null) + { + isVrcAvatar = avatar.GetComponent(avatarType) != null; + } + Component constraint = isVrcAvatar ? + fixedRoot.GetComponent(System.Type.GetType("VRC.SDK3.Dynamics.Constraint.Components.VRCParentConstraint, VRC.SDK3.Dynamics.Constraint")) : + fixedRoot.GetComponent(); + Assert.That(constraint, Is.Not.Null); // objects are moved to fixed root Assert.That(movedFixedObject, Is.Not.Null);