DataBoardDemo/assets/Script/Hero.ts

27 lines
503 B
TypeScript
Raw Permalink Normal View History

2023-04-21 18:25:25 +00:00
const {ccclass, property} = cc._decorator;
@ccclass
export default class Helloworld extends cc.Component {
hp = 100;
mp = 60;
2023-05-24 05:06:43 +00:00
equip = {
name:'装备',
sword:{
name:'小刀',
attack:30
},
shoe:{
name:'草鞋',
attr:{
name:'属性',
speed:5,
durable:100
}
}
}
2023-04-21 18:25:25 +00:00
update (dt) {
this.hp += 1.0*dt;
this.mp += 0.5*dt;
}
}