From 1341a46138bb2e3243835351b66dcc3a18e760c0 Mon Sep 17 00:00:00 2001 From: ousttrue Date: Wed, 12 Feb 2025 14:18:01 +0900 Subject: [PATCH] call HumanPoseHandler --- .../Runtime/UniHumanoid/HumanPoseTransfer.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Assets/UniGLTF/Runtime/UniHumanoid/HumanPoseTransfer.cs b/Assets/UniGLTF/Runtime/UniHumanoid/HumanPoseTransfer.cs index d9ee1a829..ea7f7a94d 100644 --- a/Assets/UniGLTF/Runtime/UniHumanoid/HumanPoseTransfer.cs +++ b/Assets/UniGLTF/Runtime/UniHumanoid/HumanPoseTransfer.cs @@ -65,6 +65,15 @@ namespace UniHumanoid } HumanPoseHandler m_handler; + public void Dispose() + { + if (m_handler != null) + { + m_handler.Dispose(); + m_handler = null; + } + } + public void OnEnable() { if (TryGetComponent(out var animator)) @@ -75,12 +84,18 @@ namespace UniHumanoid Setup(); } + void OnDisable() + { + Dispose(); + } + public void Setup() { if (Avatar == null) { return; } + Dispose(); m_handler = new HumanPoseHandler(Avatar, transform); }