Skip to content

Commit

Permalink
fixing bugs with plugin integration
Browse files Browse the repository at this point in the history
  • Loading branch information
bdunderscore committed Aug 23, 2023
1 parent 02e148f commit 9318efc
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 6 deletions.
6 changes: 3 additions & 3 deletions Assets/_ModularAvatar/EditModeTests/BoneProxyTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ public void TestNonHumanoidTarget()

var boneProxy = reference.AddComponent<ModularAvatarBoneProxy>();
boneProxy.target = root.transform;
boneProxy.ClearCache();
boneProxy.ClearCache(true);
Assert.AreEqual(root.transform, boneProxy.target);

boneProxy.target = target.transform;
boneProxy.ClearCache();
boneProxy.ClearCache(true);
Assert.AreEqual(target.transform, boneProxy.target);

target.name = "target2";
boneProxy.ClearCache();
boneProxy.ClearCache(true);
Assert.IsNull(boneProxy.target);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ public void mergeProcessesInTopoOrder()

nadena.dev.build_framework.BuildContext context =
new nadena.dev.build_framework.BuildContext(root.GetComponent<VRCAvatarDescriptor>(), null);
context.ActivateExtensionContext<ModularAvatarContext>();
context.ActivateExtensionContext(typeof(TrackObjectRenamesContext));
new MergeArmatureHook().OnPreprocessAvatar(context, root);

Expand Down Expand Up @@ -83,6 +84,7 @@ public void canDisableNameMangling()

nadena.dev.build_framework.BuildContext context =
new nadena.dev.build_framework.BuildContext(root.GetComponent<VRCAvatarDescriptor>(), null);
context.ActivateExtensionContext<ModularAvatarContext>();
context.ActivateExtensionContext(typeof(TrackObjectRenamesContext));
new MergeArmatureHook().OnPreprocessAvatar(context, root);

Expand All @@ -106,6 +108,7 @@ public void manglesByDefault()

nadena.dev.build_framework.BuildContext context =
new nadena.dev.build_framework.BuildContext(root.GetComponent<VRCAvatarDescriptor>(), null);
context.ActivateExtensionContext<ModularAvatarContext>();
context.ActivateExtensionContext(typeof(TrackObjectRenamesContext));
new MergeArmatureHook().OnPreprocessAvatar(context, root);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.Linq;
using modular_avatar_tests;
using nadena.dev.build_framework.runtime;
using nadena.dev.modular_avatar.core;
using nadena.dev.modular_avatar.core.editor;
using NUnit.Framework;
Expand Down Expand Up @@ -60,7 +61,7 @@ void AssertTempAsset(UnityEngine.Object obj)
Assert.False(string.IsNullOrEmpty(path));

var mainAsset = AssetDatabase.LoadMainAssetAtPath(path);
Assert.IsInstanceOf<MAAssetBundle>(mainAsset);
Assert.IsInstanceOf<GeneratedAssets>(mainAsset);
}
}
}
3 changes: 2 additions & 1 deletion Assets/_ModularAvatar/EditModeTests/Tests.asmdef
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"GUID:b906909fcc54f634db50f2cad0f988d9",
"GUID:3456780c4fb2d324ab9c633d6f1b0ddb",
"GUID:e9745f6a32442194c8dc5a43e9ab86f9",
"GUID:62ced99b048af7f4d8dfe4bed8373d76"
"GUID:62ced99b048af7f4d8dfe4bed8373d76",
"GUID:fe747755f7b44e048820525b07f9b956"
],
"includePlatforms": [
"Editor"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,15 @@ protected override void OnValidate()

internal void ClearCache()
{
if (_targetCache != null)
ClearCache(false);
}

internal void ClearCache(bool immediate)
{
if (immediate)
{
_targetCache = null;
} else if (_targetCache != null)
{
RuntimeUtil.delayCall(() => { _targetCache = null; });
}
Expand Down

0 comments on commit 9318efc

Please sign in to comment.