mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-05-14 06:19:47 -05:00
Merge pull request #2212 from tsgcpp/feature/skip_vrm10instance_instantiation
Vrm10Instance生成後に非アクティブにしてそのままOnDestroy()が実施された場合にエラーとなる問題の対策
This commit is contained in:
commit
bbff2fa095
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user