Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

inactive scene is updated after transition complete #5550

Closed
mijinc0 opened this issue Feb 9, 2021 · 4 comments
Closed

inactive scene is updated after transition complete #5550

mijinc0 opened this issue Feb 9, 2021 · 4 comments

Comments

@mijinc0
Copy link

mijinc0 commented Feb 9, 2021

Version

  • Phaser Version: 3.52.0
  • Operating system: ubuntu 18.04
  • Browser: chrome

Description

Hi,

I tried to use scene Transition and I found inactive scene was updated after shutdown (only once).

I’m not familiar with Phaser, system.sceneUpdate.call seems to be called after scenePlugin.transitionComplete.

// Scene.System
step: function (time, delta)
{
  var events = this.events;

  events.emit(Events.PRE_UPDATE, time, delta);

  // 'scenePlugin.transitionComplete' is called and scene will be inactive
  events.emit(Events.UPDATE, time, delta);

  // update inactive scene
  this.sceneUpdate.call(this.scene, time, delta);

  events.emit(Events.POST_UPDATE, time, delta);
},

Example Test Code

Transition was started as following…

// from : scene.system.settings{active: true,  status: 5 ...}
// to   : scene.system.settings{active: false, status: 1 ...}
 
this.scene.transition({
  target: 'anotherScene',
  duration: 2000,
  remove: false,
  allowInput: false,
  onUpdate: (progress: number]) => {
    console.log(`transition: ${progress}`);
  }
});
@photonstorm
Copy link
Collaborator

This issue has been mentioned on Phaser. There might be relevant details there:

https://phaser.discourse.group/t/inactive-scene-is-updated-after-transition-complete/8850/3

@samme
Copy link
Contributor

samme commented Feb 9, 2021

Scene POST_UPDATE also fires once after transition completes as well.

Here is an example of both: https://codepen.io/samme/pen/ExNgKLY. Click to start transition, wait for transition to complete, then see failed assertions in console.

samme added a commit to samme/phaser that referenced this issue Jul 9, 2021
@samme
Copy link
Contributor

samme commented Jul 20, 2021

I made a fix but it's a little weird: samme@4f02236

@photonstorm
Copy link
Collaborator

Thank you for submitting this issue. We have fixed this and the fix has been pushed to the master branch. It will be part of the next release. If you get time to build and test it for yourself we would appreciate that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants