AdamsLair / duality

a 2D Game Development Framework
https://adamslair.github.io/duality
MIT License
1.4k stars 289 forks source link

Fix Object inspector auto refresh issue #760

Closed SirePi closed 4 years ago

SirePi commented 4 years ago

This fixes issue #752. Don't know how it was managed before, but apparently Time.MainTimer resets every time the sandbox starts while the lastRefreshTime variable doesn't. This fix checks for situations in which lastRefreshTime is greater than MainTimer (possible only when MainTimer got restarted) and sets lastRefreshTime to MainTimer so that the usual logic can take place properly.

ilexp commented 4 years ago

Ohh, that makes sense - I recently introduced that Time gets reset every time the sandbox is entered. Nice find. Thanks! Merging this.