ShenNong_Simple/assets/Script/Block.ts
2024-10-30 15:28:42 +08:00

46 lines
749 B
TypeScript

const {ccclass, property} = cc._decorator;
@ccclass
export default class NewClass extends cc.Component {
@property(cc.Label)
label: cc.Label = null;
@property
text: string = 'hello';
tween: cc.Tween<cc.Node>;
speed: number; //移动速度,时间参数,位移个固定
move: boolean; //是否在移动状态。
num: number;
difficulty: number;
// LIFE-CYCLE CALLBACKS:
onLoad () {
}
start () {
}
init(){
}
hide(){
cc.tween(this.node)
.to(0.2,{opacity:0})
.call(() =>{
this.node.active = false;
this.node.removeFromParent();
this.node = null;
})
.start();
}
update (dt) {
}
}