|
|
@@ -18,11 +18,11 @@ export default class MoveUpAndDown extends cc.Component {
|
|
|
// let pos = cc.Vec3.ZERO;
|
|
|
// this.startPos.add(this.moveOffset, pos);
|
|
|
|
|
|
- cc.tween(this.node).delay(0.2).call(()=>{
|
|
|
-
|
|
|
- this.node.position = this.startPos;
|
|
|
-
|
|
|
- }).by(this.duration, { y: this.moveOffset.y }).by(this.duration, { y: -this.moveOffset.y }, cc.easeSineOut()).union().repeatForever().start();
|
|
|
+ let move1= cc.moveBy(this.duration, cc.v2(this.moveOffset.x, this.moveOffset.y));
|
|
|
+ let move2 = cc.moveBy(this.duration, cc.v2(this.moveOffset.x, -this.moveOffset.y));
|
|
|
+ let seq= cc.sequence([move1, move2]);
|
|
|
+ this.node.runAction(cc.repeatForever(seq));
|
|
|
+ //cc.tween(this.node).by(this.duration, { y: this.moveOffset.y }).by(this.duration, { y: -this.moveOffset.y }, cc.easeSineOut()).union().repeatForever().start();
|
|
|
|
|
|
}
|
|
|
}
|