feat: update manager now calls last frames listeners on process exit as well
This commit is contained in:
parent
b04e0f81cd
commit
d78c42a653
@ -75,9 +75,16 @@ public class UpdateManager : Behaviour
|
||||
args.BehaviourRemoved.LastActiveFrame();
|
||||
}
|
||||
|
||||
private void CallLastFramesBeforeExit(object? sender, System.EventArgs e)
|
||||
{
|
||||
for (int i = lastFrameUpdates.Count - 1; i >= 0; i--)
|
||||
lastFrameUpdates[i].LastActiveFrame();
|
||||
}
|
||||
|
||||
public UpdateManager()
|
||||
{
|
||||
firstFrameUpdates.OnCollected.AddListener(OnFirstFrameCollected);
|
||||
lastFrameUpdates.OnRemoved.AddListener(OnLastFrameRemoved);
|
||||
System.AppDomain.CurrentDomain.ProcessExit += CallLastFramesBeforeExit;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user