{ "sourceFile": "assets/scripts/Game/Car.ts", "activeCommit": 0, "commits": [ { "activePatchIndex": 6, "patches": [ { "date": 1694593496402, "content": "Index: \n===================================================================\n--- \n+++ \n" }, { "date": 1694593523132, "content": "Index: \n===================================================================\n--- \n+++ \n@@ -9,9 +9,13 @@\n @property(Node)\r\n lun2: Node = null;\r\n \r\n onLoad() {\r\n+ this.node.on(\"init\", this.init, this);\r\n+ }\r\n \r\n+ init() {\r\n+ \r\n }\r\n }\r\n \r\n \r\n" }, { "date": 1694593700664, "content": "Index: \n===================================================================\n--- \n+++ \n@@ -1,5 +1,5 @@\n-import { _decorator, Component, Node } from 'cc';\r\n+import { _decorator, Component, Node, Tween, tween } from 'cc';\r\n const { ccclass, property } = _decorator;\r\n \r\n @ccclass('Car')\r\n export class Car extends Component {\r\n@@ -13,9 +13,14 @@\n this.node.on(\"init\", this.init, this);\r\n }\r\n \r\n init() {\r\n- \r\n+ Tween.stopAllByTarget(this.lun1);\r\n+ Tween.stopAllByTarget(this.lun2);\r\n+ this.lun1.angle = 0;\r\n+ this.lun2.angle = 0;\r\n+ tween(this.lun1).by(1, { angle: 360 }).start();\r\n+ tween(this.lun2).by(1, { angle: 360 }).start();\r\n }\r\n }\r\n \r\n \r\n" }, { "date": 1694594028031, "content": "Index: \n===================================================================\n--- \n+++ \n@@ -1,5 +1,5 @@\n-import { _decorator, Component, Node, Tween, tween } from 'cc';\r\n+import { _decorator, Component, Node, Tween, tween, AudioSource } from 'cc';\r\n const { ccclass, property } = _decorator;\r\n \r\n @ccclass('Car')\r\n export class Car extends Component {\r\n@@ -8,8 +8,11 @@\n \r\n @property(Node)\r\n lun2: Node = null;\r\n \r\n+ @property(AudioSource)\r\n+ audio: AudioSource = null;\r\n+\r\n onLoad() {\r\n this.node.on(\"init\", this.init, this);\r\n }\r\n \r\n" }, { "date": 1694594072956, "content": "Index: \n===================================================================\n--- \n+++ \n@@ -22,8 +22,12 @@\n this.lun1.angle = 0;\r\n this.lun2.angle = 0;\r\n tween(this.lun1).by(1, { angle: 360 }).start();\r\n tween(this.lun2).by(1, { angle: 360 }).start();\r\n+ this.audio.play();\r\n+ setTimeout(() => {\r\n+ this.audio.pause();\r\n+ }, 1 * 1000);\r\n }\r\n }\r\n \r\n \r\n" }, { "date": 1694594217797, "content": "Index: \n===================================================================\n--- \n+++ \n@@ -25,9 +25,9 @@\n tween(this.lun2).by(1, { angle: 360 }).start();\r\n this.audio.play();\r\n setTimeout(() => {\r\n this.audio.pause();\r\n- }, 1 * 1000);\r\n+ }, 1.5 * 1000);\r\n }\r\n }\r\n \r\n \r\n" }, { "date": 1694594232352, "content": "Index: \n===================================================================\n--- \n+++ \n@@ -25,9 +25,9 @@\n tween(this.lun2).by(1, { angle: 360 }).start();\r\n this.audio.play();\r\n setTimeout(() => {\r\n this.audio.pause();\r\n- }, 1.5 * 1000);\r\n+ }, 1 * 1000);\r\n }\r\n }\r\n \r\n \r\n" } ], "date": 1694593496402, "name": "Commit-0", "content": "import { _decorator, Component, Node } from 'cc';\r\nconst { ccclass, property } = _decorator;\r\n\r\n@ccclass('Car')\r\nexport class Car extends Component {\r\n @property(Node)\r\n lun1: Node = null;\r\n\r\n @property(Node)\r\n lun2: Node = null;\r\n\r\n onLoad() {\r\n\r\n }\r\n}\r\n\r\n\r\n" } ] }