- /**
- * !#en indicates whether this component is enabled or not.
- * !#zh 表示该组件自身是否启用。
- * @property enabled
- * @type {Boolean}
- * @default true
- * @example
- * comp.enabled = true;
- * cc.log(comp.enabled);
- */
- enabled: {
- get () {
- return this._enabled;
- },
- set (value) {
- if (this._enabled !== value) {
- this._enabled = value;
- if (this.node._activeInHierarchy) {
- var compScheduler = cc.director._compScheduler;
- if (value) {
- compScheduler.enableComp(this);