mirror of
https://github.com/bdunderscore/modular-avatar.git
synced 2024-12-29 02:35:06 +08:00
fix: suppress ObjectReferenceFixer in play mode (#1336)
Not sure if this will do anything, but maybe it'll help with the perf issues people have reported?
This commit is contained in:
parent
59ff119d20
commit
973e7d2448
@ -38,10 +38,23 @@ namespace nadena.dev.modular_avatar.core
|
|||||||
_context?.Invalidate?.Invoke();
|
_context?.Invalidate?.Invoke();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
EditorApplication.playModeStateChanged += state =>
|
||||||
|
{
|
||||||
|
if (state == PlayModeStateChange.EnteredEditMode)
|
||||||
|
{
|
||||||
|
EditorApplication.delayCall += ProcessObjectReferences;
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void ProcessObjectReferences()
|
private static void ProcessObjectReferences()
|
||||||
{
|
{
|
||||||
|
if (EditorApplication.isPlayingOrWillChangePlaymode)
|
||||||
|
{
|
||||||
|
_context = null;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
_lastStage = GetCurrentContentsRootId(out var contentsRoot);
|
_lastStage = GetCurrentContentsRootId(out var contentsRoot);
|
||||||
|
|
||||||
AvatarObjectReference.InvalidateAll();
|
AvatarObjectReference.InvalidateAll();
|
||||||
|
Loading…
Reference in New Issue
Block a user