Thursday, February 29, 2024
HomeGame DevelopmentWhat's the finest performant method? - Cocos Creator

What’s the finest performant method? – Cocos Creator


Hello All,

I’ve a confusion within the method that we observe to make the sport on the whole, like if we’ve got 5 nodes in a scene and we’re making 4 nodes inactive and 1 lively that’s wanted (likewise for all of the nodes), or eradicating the youngsters and including them to the container every time we’re going to want them again.


I see that you’re confused concerning the efficiency of two options.
Efficiency by eradicating and re-adding nodes and efficiency by activating or deactivating nodes

  1. The time consuming method so as to add nodes is when addChild is added to the scene. Activating/deactivating a node takes time when node.lively iterates by way of and refreshes all of the states of the node.
  2. Each of those strategies are time consuming.

One advisable method is to make the specified node a resident node (not an engine resident node, however a node that’s not faraway from the node tree) and later transfer it into the scene when it must be rendered. When not wanted for rendering, transfer out of the scene.

Are you able to please elaborate on this with a small instance? it’s attention-grabbing additionally I’m not getting what’s resident node precisely is.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments

Arnavsijapati on Planet of Lana – Beta Demo
Jai Kishor Upadhyay on Planet of Lana – Beta Demo