mirror of
https://github.com/bdunderscore/modular-avatar.git
synced 2025-02-21 13:45:03 +08:00
fix: potential null ref exceptions from scale adjuster (#767)
This commit is contained in:
parent
a801f0ee76
commit
3f50da35f2
@ -54,6 +54,12 @@ namespace nadena.dev.modular_avatar.core
|
|||||||
|
|
||||||
internal void PreCull()
|
internal void PreCull()
|
||||||
{
|
{
|
||||||
|
if (this == null)
|
||||||
|
{
|
||||||
|
EditorApplication.delayCall += () => ProxyManager.UnregisterAdjuster(this);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (PrefabUtility.IsPartOfPrefabAsset(this)) return;
|
if (PrefabUtility.IsPartOfPrefabAsset(this)) return;
|
||||||
|
|
||||||
if (scaleProxyChild == null || initialized == false)
|
if (scaleProxyChild == null || initialized == false)
|
||||||
|
@ -102,6 +102,10 @@ namespace nadena.dev.modular_avatar.core
|
|||||||
// Give each adjuster a chance to initialize the bone mappings first
|
// Give each adjuster a chance to initialize the bone mappings first
|
||||||
foreach (var adj in _capturedAdjusters)
|
foreach (var adj in _capturedAdjusters)
|
||||||
{
|
{
|
||||||
|
if (adj == null)
|
||||||
|
{
|
||||||
|
_capturedAdjusters = _adjusters = _adjusters.Remove(adj);
|
||||||
|
}
|
||||||
adj.PreCull();
|
adj.PreCull();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -255,6 +259,10 @@ namespace nadena.dev.modular_avatar.core
|
|||||||
|
|
||||||
foreach (var adj in _capturedAdjusters)
|
foreach (var adj in _capturedAdjusters)
|
||||||
{
|
{
|
||||||
|
if (adj == null)
|
||||||
|
{
|
||||||
|
_capturedAdjusters = _capturedAdjusters.Remove(adj);
|
||||||
|
}
|
||||||
adj.PreCull(); // update scale
|
adj.PreCull(); // update scale
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user