You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The scene graph and the entity component system that is present is a hacky implementation, and needs some cleaning to be better. We mainly need to clean this so we can guarantee a scene life cycle.
Convert components from interfaces to abstract classes.
Hide all the children and component collections in Entity classes.
Add instantiation methods and destruction methods.
Give an ID to all entities and components, for easy debugging.
All entities should have a destroyed flag set by the destruction methods.
The life cycle of the component is as follows:
create(Entity): Called just after adding to the entity. Also receives the entity reference that it is attached to.
init(): Called before the first update if the component is newly added.
update(float): Standard update method of the component. Receives the delta time.
render(float): Standard render method of the component. Receives the delta time.
dispose(): Called when the entity is destroyed and the components are about to be deleted.
With this, we can guarantee the life cycle of components. The same also goes with the entities and scenes.
The text was updated successfully, but these errors were encountered:
The scene graph and the entity component system that is present is a hacky implementation, and needs some cleaning to be better. We mainly need to clean this so we can guarantee a scene life cycle.
The life cycle of the component is as follows:
With this, we can guarantee the life cycle of components. The same also goes with the entities and scenes.
The text was updated successfully, but these errors were encountered: