更新代码

This commit is contained in:
Leo
2022-01-09 16:25:33 +08:00
parent 4726b45a89
commit 08c98b587a
26 changed files with 15 additions and 4 deletions

View File

@@ -1,2 +0,0 @@
# hello-world
Hello world new project template.

2
TweenDemo/README.md Normal file
View File

@@ -0,0 +1,2 @@
# TweenDemo
添加一个使用Tween的demo,测试环境这ccc 2.4.5

View File

@@ -923,7 +923,7 @@
"component": "",
"_componentId": "f6462UR+MlIhI9Hg1W9ywCa",
"handler": "onEventClick",
"customEventData": "7"
"customEventData": "9"
},
{
"__type__": "cc.Node",
@@ -1308,7 +1308,7 @@
"component": "",
"_componentId": "f6462UR+MlIhI9Hg1W9ywCa",
"handler": "onEventClick",
"customEventData": "8"
"customEventData": "10"
},
{
"__type__": "cc.Canvas",

View File

@@ -35,6 +35,10 @@ export default class TweemTest extends cc.Component {
this.progressAction(this.targetNode);
} else if (custom == '8') {
this.stopAction(this.curTw)
} else if (custom == "9") {
this.bezierAction(this.targetNode);
} else if (custom == "10") {
this.stopAction(this.curTw);
}
}
@@ -209,5 +213,12 @@ export default class TweemTest extends cc.Component {
}).union().repeatForever().start();
}
bezierAction(node: cc.Node) {
this.resetNode(node);
this.curTw = cc.tween(node).bezierTo(5, cc.v2(0, 0), cc.v2(150, 350), cc.v2(300, 0)).call(() => {
this.resetNode(node);
}).union().repeatForever().start();
}
// update (dt) {}
}

View File

Before

Width:  |  Height:  |  Size: 37 KiB

After

Width:  |  Height:  |  Size: 37 KiB

View File

Before

Width:  |  Height:  |  Size: 82 B

After

Width:  |  Height:  |  Size: 82 B

View File

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 23 KiB