You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
873 B
41 lines
873 B
const {ccclass, property} = cc._decorator;
|
|
|
|
@ccclass
|
|
export default class ScaleNode extends cc.Component {
|
|
@property(cc.Float)
|
|
scaleStart: number = 1;
|
|
|
|
@property(cc.Float)
|
|
scaleEnd: number = 1;
|
|
|
|
@property(cc.Float)
|
|
delayTime: number = 1;
|
|
|
|
@property(cc.Float)
|
|
time: number = 0.2;
|
|
|
|
@property(cc.Float)
|
|
opacityNum: number = 0;
|
|
// LIFE-CYCLE CALLBACKS:
|
|
|
|
onLoad () {
|
|
this.node.scale = this.scaleStart;
|
|
cc.tween(this.node).delay(this.delayTime)
|
|
.repeatForever(
|
|
cc.tween()
|
|
.to(this.time, { scale: this.scaleEnd})
|
|
.to(this.time*3, { opacity: this.opacityNum })
|
|
.call(()=>{
|
|
this.node.scale = this.scaleStart;
|
|
this.node.opacity = 255;
|
|
})
|
|
)
|
|
.start()
|
|
}
|
|
|
|
start () {
|
|
|
|
}
|
|
|
|
// update (dt) {}
|
|
}
|
|
|