mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-09-09 04:19:42 -05:00
fix: Skip Vrm10Runtime instantiation after the GameObject is destroyed
This commit is contained in:
@@ -95,6 +95,7 @@ namespace UniVRM10
|
||||
{
|
||||
if (m_runtime == null)
|
||||
{
|
||||
if (this == null) throw new MissingReferenceException("instance was destroyed");
|
||||
m_runtime = new Vrm10Runtime(this, m_useControlRig);
|
||||
}
|
||||
return m_runtime;
|
||||
@@ -138,7 +139,11 @@ namespace UniVRM10
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
Runtime.Dispose();
|
||||
if (m_runtime != null)
|
||||
{
|
||||
m_runtime.Dispose();
|
||||
m_runtime = null;
|
||||
}
|
||||
}
|
||||
|
||||
private void OnDrawGizmosSelected()
|
||||
|
||||
Reference in New Issue
Block a user