标签:component 动态 end xtend lang creat port pre OLE
Test.ts
const{ccclass,property}=cc._decorator;
var KEY=cc.Enum({});
Object.assign(KEY,cc.macro.KEY);
@ccclass
export default class Test extends cc.Component{
@property({type:KEY,visible:true})
private _leftKey:cc.macro.KEY=cc.macro.KEY.a;
@property({visible:true,})
private _enableSecondKey:boolean=false;
@property({type:KEY, visible(){return this._enableSecondKey;} })
private _leftKey2:cc.macro.KEY=cc.macro.KEY.left;
}
CocosCreator 动态设置属性在Properties面板显示/隐藏
标签:component 动态 end xtend lang creat port pre OLE
原文地址:https://www.cnblogs.com/kingBook/p/13261953.html