Merge branch 'fix/ForceUniqueName_timing' of ssh://github.com/ousttrue/UniVRM into fix/ForceUniqueName_timing

This commit is contained in:
ousttrue 2025-02-12 15:10:22 +09:00
commit 3f72ebe41c

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);
}