The Clock.now property value is now synced to be the TimeStep.time value when the Clock plugin boots and is no longer Date.now() until the first update

This commit is contained in:
Richard Davey 2019-03-26 14:35:14 +00:00
parent ab2f489c5a
commit 6a2397bbae
2 changed files with 5 additions and 1 deletions

View file

@ -67,6 +67,7 @@ Notes:
* The `PluginManager.installScenePlugin` method has a new optional boolean parameter `fromLoader` which controls if the plugin is coming in from the result of a Loader operation or not. If it is, it no longer throws a console warning if the plugin already exists. This fixes an issue where if you return to a Scene that loads a Scene Plugin it would throw a warning and then not install the plugin to the Scene.
* The Scale Manager has a new event `FULLSCREEN_FAILED` which is fired if you try to enter fullscreen mode, but the browser rejects it for some reason.
* The `ScaleMode` Component has been removed from every Game Object, and along with it the `scaleMode` property and `setScaleMode` method. These did nothing anyway as they were not hooked to the render pipeline and scale mode should be set on the texture, not the Game Object. Fix #4413 (thanks @jcyuan)
* The `Clock.now` property value is now synced to be the `TimeStep.time` value when the Clock plugin boots and is no longer `Date.now()` until the first update (thanks @Antriel)
### Bug Fixes

View file

@ -53,7 +53,7 @@ var Clock = new Class({
* @type {number}
* @since 3.0.0
*/
this.now = Date.now();
this.now = 0;
// Scale the delta time coming into the Clock by this factor
// which then influences anything using this Clock for calculations, like TimerEvents
@ -129,6 +129,9 @@ var Clock = new Class({
*/
boot: function ()
{
// Sync with the TimeStep
this.now = this.systems.game.loop.time;
this.systems.events.once(SceneEvents.DESTROY, this.destroy, this);
},