mirror of
https://github.com/Leo501/CocosCreatorTutorial.git
synced 2026-06-04 08:37:28 +08:00
更新代码
This commit is contained in:
@@ -1,2 +0,0 @@
|
||||
# hello-world
|
||||
Hello world new project template.
|
||||
2
TweenDemo/README.md
Normal file
2
TweenDemo/README.md
Normal file
@@ -0,0 +1,2 @@
|
||||
# TweenDemo
|
||||
添加一个使用Tween的demo,测试环境这ccc 2.4.5
|
||||
@@ -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",
|
||||
@@ -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) {}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 37 KiB |
|
Before Width: | Height: | Size: 82 B After Width: | Height: | Size: 82 B |
|
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 23 KiB |
Reference in New Issue
Block a user