Constructor
(private) new ZoneComponent(system, size)
Parameters:
Name | Type | Description |
---|---|---|
system |
pc.ZoneComponentSystem | The ComponentSystem that created this Component |
size |
pc.Vec3 | The Size of Box of a Zone. |
Extends
Events
disable
Fired when Component becomes disabled
Note: this event does not take in account entity or any of its parent enabled state
Example
entity.zone.on('disable', function () {
// component is disabled
});
enable
Fired when Component becomes enabled
Note: this event does not take in account entity or any of its parent enabled state
Example
entity.zone.on('enable', function () {
// component is enabled
});
remove
Fired when a zone is removed from an entity
Example
entity.zone.on('remove', function () {
// zone has been removed from an entity
});
state
Fired when Component changes state to enabled or disabled
Note: this event does not take in account entity or any of its parent enabled state
Parameters:
Name | Type | Description |
---|---|---|
enabled |
Boolean | True if now enabled, False if disabled |
Example
entity.zone.on('state', function (enabled) {
// component changed state
});