#How to hide/destroy an entity?
1 messages · Page 1 of 1 (latest)
that's structural change
it's unclear what you want, and why you want "no structural changes"
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.
- 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))
Much thanks!
But it's rather difficult to hide an entity without structural change, right?