From 2681c1d4c08be7b22a0124802a763537ef182e97 Mon Sep 17 00:00:00 2001 From: bd_ Date: Fri, 9 Sep 2022 20:36:04 -0700 Subject: [PATCH] Fix state leakage across builds --- .../net.fushizen.modular-avatar/Editor/MergeAnimatorHook.cs | 3 +++ .../net.fushizen.modular-avatar/Editor/MergeArmatureHook.cs | 3 +++ 2 files changed, 6 insertions(+) diff --git a/Packages/net.fushizen.modular-avatar/Editor/MergeAnimatorHook.cs b/Packages/net.fushizen.modular-avatar/Editor/MergeAnimatorHook.cs index 9db84717..fde020cf 100644 --- a/Packages/net.fushizen.modular-avatar/Editor/MergeAnimatorHook.cs +++ b/Packages/net.fushizen.modular-avatar/Editor/MergeAnimatorHook.cs @@ -46,6 +46,9 @@ namespace net.fushizen.modular_avatar.core.editor public bool OnPreprocessAvatar(GameObject avatarGameObject) { + defaultControllers_.Clear(); + mergeSessions.Clear(); + var descriptor = avatarGameObject.GetComponent(); InitSessions(descriptor.baseAnimationLayers); diff --git a/Packages/net.fushizen.modular-avatar/Editor/MergeArmatureHook.cs b/Packages/net.fushizen.modular-avatar/Editor/MergeArmatureHook.cs index ae295103..ee98f0af 100644 --- a/Packages/net.fushizen.modular-avatar/Editor/MergeArmatureHook.cs +++ b/Packages/net.fushizen.modular-avatar/Editor/MergeArmatureHook.cs @@ -43,6 +43,9 @@ namespace net.fushizen.modular_avatar.core.editor public bool OnPreprocessAvatar(GameObject avatarGameObject) { + BoneRemappings.Clear(); + ToDelete.Clear(); + var mergeArmatures = avatarGameObject.transform.GetComponentsInChildren(true); BoneRemappings.Clear();