mirror of
https://github.com/unity-atoms/unity-atoms.git
synced 2025-01-21 23:58:49 -05:00
removed the dead-reference handling (#417)
- this will be addressed in (#421) compacted the Playmode state change
This commit is contained in:
parent
6e51c70f33
commit
108ad1a2d8
@ -62,15 +62,8 @@ namespace UnityAtoms
|
||||
#if UNITY_EDITOR
|
||||
private static void HandlePlayModeStateChange(PlayModeStateChange state)
|
||||
{
|
||||
if (state == PlayModeStateChange.ExitingEditMode) // BEFORE any GO is initialized:
|
||||
{
|
||||
foreach (var instance in _instances)
|
||||
{
|
||||
instance._replayBuffer.Clear();
|
||||
instance.UnregisterAll();
|
||||
}
|
||||
}
|
||||
else if (state == PlayModeStateChange.EnteredEditMode) // AFTER Playmode stopped
|
||||
if (state == PlayModeStateChange.ExitingEditMode // BEFORE any GO is initialized:
|
||||
|| state == PlayModeStateChange.EnteredEditMode) // AFTER Playmode stopped
|
||||
{
|
||||
foreach (var instance in _instances)
|
||||
{
|
||||
|
@ -74,11 +74,6 @@ namespace UnityAtoms
|
||||
{
|
||||
foreach (var instance in _instances)
|
||||
{
|
||||
if (instance == null)
|
||||
{
|
||||
_instances.Remove(instance);
|
||||
continue;
|
||||
}
|
||||
if(instance._startCleared) instance.list.Clear();
|
||||
instance._initial = instance.list.ToList();
|
||||
}
|
||||
@ -87,11 +82,6 @@ namespace UnityAtoms
|
||||
{
|
||||
foreach (var instance in _instances)
|
||||
{
|
||||
if (instance == null) // might be for UnityEngine.Objects
|
||||
{
|
||||
_instances.Remove(instance);
|
||||
continue;
|
||||
}
|
||||
instance.list = instance._initial;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user