Called when a component is being assigned to an entity with Ecs.assign, passing in the entity it was assigned to.
Called when a component is being removed from an entity with Ecs.remove, passing in the entity it was assigned to. This is also called when the entity is destroyed with Ecs.destroy and all its components are removed.
Components can optionally define these lifecycle methods to respond to assignment and removal to and from entities. These are useful if the component is managing a resource outside of the ECS.