Wednesday, February 21, 2024
HomeGame DevelopmentWhat's the greatest performant strategy? - Cocos Creator

What’s the greatest performant strategy? – Cocos Creator

Hello All,

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

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

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

One really useful manner is to make the specified node a resident node (not an engine resident node, however a node that isn’t 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.

1 Like

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

For instance you are able to do the next :
If we are saying you created a button than adjustments the menu state fron inactive to energetic … as a substitute of doing so you are able to do the next :
1.Make the menu energetic and set it place to exterior of the scene
2.When clicking on the button you modify the menu place to the specified place contained in the scene
I hope that helped :))



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