mirror of
https://github.com/bdunderscore/modular-avatar.git
synced 2025-04-04 19:49:02 +08:00
Fix assert fail
This commit is contained in:
parent
b61e3f559b
commit
b0f4f3d30a
@ -27,11 +27,13 @@ public class WorldFixedObjectTest : TestBase
|
||||
// fixed root is created
|
||||
Assert.That(fixedRoot, Is.Not.Null);
|
||||
bool isVrcAvatar = false;
|
||||
#if MA_VRCSDK3_AVATARS_3_7_0_OR_NEWER
|
||||
System.Type vrcParentConstraintType = null;
|
||||
#if MA_VRCSDK3_AVATARS
|
||||
isVrcAvatar = avatar.TryGetComponent(out VRC.SDKBase.VRC_AvatarDescriptor _);
|
||||
vrcParentConstraintType = System.Type.GetType("VRC.SDK3.Dynamics.Constraint.Components.VRCParentConstraint, VRC.SDK3.Dynamics.Constraint");
|
||||
#endif
|
||||
Component constraint = isVrcAvatar ?
|
||||
fixedRoot.GetComponent(System.Type.GetType("VRC.SDK3.Dynamics.Constraint.Components.VRCParentConstraint, VRC.SDK3.Dynamics.Constraint")) :
|
||||
Component constraint = isVrcAvatar && vrcParentConstraintType != null ?
|
||||
fixedRoot.GetComponent(vrcParentConstraintType) :
|
||||
fixedRoot.GetComponent<ParentConstraint>();
|
||||
Assert.That(constraint, Is.Not.Null);
|
||||
|
||||
@ -61,11 +63,13 @@ public class WorldFixedObjectTest : TestBase
|
||||
// fixed root is created
|
||||
Assert.That(fixedRoot, Is.Not.Null);
|
||||
bool isVrcAvatar = false;
|
||||
#if MA_VRCSDK3_AVATARS_3_7_0_OR_NEWER
|
||||
System.Type vrcParentConstraintType = null;
|
||||
#if MA_VRCSDK3_AVATARS
|
||||
isVrcAvatar = avatar.TryGetComponent(out VRC.SDKBase.VRC_AvatarDescriptor _);
|
||||
vrcParentConstraintType = System.Type.GetType("VRC.SDK3.Dynamics.Constraint.Components.VRCParentConstraint, VRC.SDK3.Dynamics.Constraint");
|
||||
#endif
|
||||
Component constraint = isVrcAvatar ?
|
||||
fixedRoot.GetComponent(System.Type.GetType("VRC.SDK3.Dynamics.Constraint.Components.VRCParentConstraint, VRC.SDK3.Dynamics.Constraint")) :
|
||||
Component constraint = isVrcAvatar && vrcParentConstraintType != null ?
|
||||
fixedRoot.GetComponent(vrcParentConstraintType) :
|
||||
fixedRoot.GetComponent<ParentConstraint>();
|
||||
Assert.That(constraint, Is.Not.Null);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user