Fix unit test build error

This commit is contained in:
JLChnToZ 2024-11-13 22:27:35 +08:00
parent 268d04ed3e
commit b61e3f559b

View File

@ -3,6 +3,7 @@ using nadena.dev.modular_avatar.animation;
using nadena.dev.modular_avatar.core;
using nadena.dev.modular_avatar.core.editor;
using NUnit.Framework;
using UnityEngine;
using UnityEngine.Animations;
public class WorldFixedObjectTest : TestBase
@ -25,12 +26,10 @@ public class WorldFixedObjectTest : TestBase
// fixed root is created
Assert.That(fixedRoot, Is.Not.Null);
var avatarType = System.Type.GetType("VRC.SDKBase.VRC_AvatarDescriptor, VRCSDKBase");
bool isVrcAvatar = false;
if (avatarType != null)
{
isVrcAvatar = avatar.GetComponent(avatarType) != null;
}
#if MA_VRCSDK3_AVATARS_3_7_0_OR_NEWER
isVrcAvatar = avatar.TryGetComponent(out VRC.SDKBase.VRC_AvatarDescriptor _);
#endif
Component constraint = isVrcAvatar ?
fixedRoot.GetComponent(System.Type.GetType("VRC.SDK3.Dynamics.Constraint.Components.VRCParentConstraint, VRC.SDK3.Dynamics.Constraint")) :
fixedRoot.GetComponent<ParentConstraint>();
@ -61,12 +60,10 @@ public class WorldFixedObjectTest : TestBase
// fixed root is created
Assert.That(fixedRoot, Is.Not.Null);
var avatarType = System.Type.GetType("VRC.SDKBase.VRC_AvatarDescriptor, VRCSDKBase");
bool isVrcAvatar = false;
if (avatarType != null)
{
isVrcAvatar = avatar.GetComponent(avatarType) != null;
}
#if MA_VRCSDK3_AVATARS_3_7_0_OR_NEWER
isVrcAvatar = avatar.TryGetComponent(out VRC.SDKBase.VRC_AvatarDescriptor _);
#endif
Component constraint = isVrcAvatar ?
fixedRoot.GetComponent(System.Type.GetType("VRC.SDK3.Dynamics.Constraint.Components.VRCParentConstraint, VRC.SDK3.Dynamics.Constraint")) :
fixedRoot.GetComponent<ParentConstraint>();