#How to hide/destroy an entity?

1 messages · Page 1 of 1 (latest)

ornate halo
#

Have a nice day, guys.
I'd like to ask how to hide/destroy an entity without triggering structure changes?
I tried ECB.DestroyEntity, but does it good?

lost pulsar
#

it's unclear what you want, and why you want "no structural changes"

#

so it's best if you just explain it

ornate halo
# lost pulsar so it's best if you just explain it

I simply just want the entity to "disappear" from the screen.
I read the dots' manual and scripting API and understand that I should avoid structural change because of affecting the performance. Except for the ECB.DestroyEntity(entity), I don't see any warning or note.

#

In non-dots concept, I just need to Destroy the GameObject or hide it in object's pool.

ebon oriole
#
  • Stop Rendering - disable MaterialMeshInfo but will still exist/simulate just won't be visible (similar to disabling MeshRenderer)
  • Disable but keep data - Add Disabled component, structural change but will no longer appear in queries/simulate but will keep data. Can remove Disabled to continue simulating with same data (similar to GameObject.SetActive(false))
  • Destroy - Ecb/Em.Destroy to fully destroy an object (smilar to Object.Destroy(gameobject))
ornate halo
ebon oriole
#

hide is the wrong word for what you mean to say?

#

because hide is just turn off renderer

#

and that requires no structural changes

#

what you seem to want to do is destroy which by definition is a structural change