Merge branch 'master' into fix/ForceUniqueName_timing

This commit is contained in:
ousttrue
2025-02-12 14:59:46 +09:00
committed by GitHub

View File

@@ -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<Animator>(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);
}