Booty5 icon indicating copy to clipboard operation
Booty5 copied to clipboard

How come app.addScene(scene)/app.removeScene(scene) but no app.destroyScene(scene)

Open BracerJack opened this issue 5 years ago • 0 comments

Documentation says: It has scene.destroy(); but it's a little inconsistent not to have app.destroyScene(scene) or even better that and app.removeAndDestroyScene(scene).

Because if you don't do that, it leads to many internal questions/unknowns. Do you have to remove the scene via app.removeScene and then scene.destroy later ? [This is syntaxtually not very beautiful.]

And what happen when you call scene.destroy without first calling app.removeScene ? Does it holds a null bug waiting to happen then since it still technically holds a scene that is no longer there ?

All these could be eliminated if app.destroyScene(scene) and app.removeAndDestroyScene(scene) is implemented.

Please correct me if I am wrong thank you because I am learning and trying to make everything consistent in my mind :-)

Another case in point, you have: scene.addResource(material, "Material"); scene.findResource("static_bounce", "Material"); scene.destroyResource("static_bounce", "Material"); //or material.destroy(); if you already have access to the material directly.

So for consistency sake, you have app.addScene, app.findScene but scene.destroy() but no app.destroyScene() is consistently wise a little strange I think.

BracerJack avatar May 07 '20 17:05 BracerJack