mirror of
https://gitlab.com/skysthelimit.dev/selenite.git
synced 2025-06-16 10:32:08 -05:00
16 lines
461 B
JavaScript
16 lines
461 B
JavaScript
var Enable = pc.createScript('enable');
|
|
|
|
Enable.attributes.add('enableEvent', { type: 'string' });
|
|
Enable.attributes.add('disableEvent', { type: 'string' });
|
|
|
|
// initialize code called once per entity
|
|
Enable.prototype.initialize = function() {
|
|
this.app.on(this.enableEvent, function () {
|
|
this.entity.enabled = true;
|
|
}, this);
|
|
|
|
this.app.on(this.disableEvent, function () {
|
|
this.entity.enabled = false;
|
|
}, this);
|
|
};
|