diff --git a/src/framework/components/component.js b/src/framework/components/component.js index ece788c0575..bfa41fd91cb 100644 --- a/src/framework/components/component.js +++ b/src/framework/components/component.js @@ -4,7 +4,6 @@ import { EventHandler } from '../../core/event-handler.js'; * Components are used to attach functionality on a {@link Entity}. Components can receive update * events each frame, and expose properties to the PlayCanvas Editor. * - * @property {boolean} enabled Enables or disables the component. * @augments EventHandler */ class Component extends EventHandler { @@ -113,6 +112,18 @@ class Component extends EventHandler { const record = this.system.store[this.entity.getGuid()]; return record ? record.data : null; } + + /** + * Enables or disables the component. + * + * @type {boolean} + */ + set enabled(arg) { + } + + get enabled() { + return true; + } } export { Component }; diff --git a/utils/types-fixup.mjs b/utils/types-fixup.mjs index 10d5355191f..ac60cc0b02d 100644 --- a/utils/types-fixup.mjs +++ b/utils/types-fixup.mjs @@ -24,15 +24,6 @@ const getDeclarations = (properties) => { return declarations; }; -const componentProps = [ - ['enabled', 'boolean'] -]; - -path = './types/framework/components/component.d.ts'; -dts = fs.readFileSync(path, 'utf8'); -dts = dts.replace(regexConstructor, '$&\n' + getDeclarations(componentProps)); -fs.writeFileSync(path, dts); - const buttonComponentProps = [ ['active', 'boolean'], ['fadeDuration', 'number'],