Fixes an issue where when an Entity is enabled, it will call OnEnabled() on all of its components, even those that are individually disabled. This appears to be a bug, as it's very counter-intuitive for Component.OnEnabled() to be called when the component is still disabled.
This behavior was causing a bug with the Collider class which can be reproduced as follows:
var collider = entity.AddComponent(new BoxCollider());
collider.Enabled = false;
// wait an update cycle
entity.Enabled = false;
// wait an update cycle
entity.Enabled = true;
// collider.OnEnabled() will then be called and the disabled collider will register itself to the physics system
(If it's desirable for a disabled Component to know when the entity is enabled, I'd propose adding an OnEntityEnabled() method to the Component class.)
I've also made several other small fixes -- methods like BoxCollider.SetSize would re-register the collider with the physics system when the collider was disabled.
Finally, the ColliderTriggerHelper class would check for trigger collisions on all of the entity's attached colliders, even if they're disabled. It will simply skip over disabled colliders now.
Fixes an issue where when an Entity is enabled, it will call OnEnabled() on all of its components, even those that are individually disabled. This appears to be a bug, as it's very counter-intuitive for Component.OnEnabled() to be called when the component is still disabled.
This behavior was causing a bug with the Collider class which can be reproduced as follows:
(If it's desirable for a disabled Component to know when the entity is enabled, I'd propose adding an OnEntityEnabled() method to the Component class.)
I've also made several other small fixes -- methods like BoxCollider.SetSize would re-register the collider with the physics system when the collider was disabled.
Finally, the ColliderTriggerHelper class would check for trigger collisions on all of the entity's attached colliders, even if they're disabled. It will simply skip over disabled colliders now.