TypeScript的装饰器的notify问题

TypeScript中定义一个属性

@property({
    type: cc.Integer,
    displayName: "Extra Line Height",
    tooltip:     "Extra Line Height for label",
    notify: function () {
        this._applyChange();
    }
})
extraLineHeight = -1;

然而在creator控制台, 总是说not yet support notify attribute for ES6 Classes
编辑器修改值时, 也没发现notify被调用的迹象

notify在 ts 中没有用,代替方法是写在 get/set 的 set 函数里。
然后添加 @executeInEditMode 装饰类名,使脚本在编辑器中运行。
如果要区分运行时, 使用 CC_EDITOR 变量判断 是否在编辑器环境。

1赞

OK, 确定可以了