cocos-awesome/assets/Script/Helloworld.ts

17 lines
289 B
TypeScript
Raw Normal View History

2020-03-29 15:52:28 +00:00
const {ccclass, property} = cc._decorator;
@ccclass
export default class Helloworld extends cc.Component {
@property(cc.Label)
label: cc.Label = null;
@property
text: string = 'hello';
start () {
// init logic
this.label.string = this.text;
}
}