Ver código fonte

test animation

yichael 1 semana atrás
pai
commit
3cd85c9670

BIN
.vs/FellTrees/FileContentIndex/2933af47-e434-4ba6-ade9-47f6ea17cc41.vsidx


BIN
.vs/FellTrees/FileContentIndex/c5e3c847-79dc-4ea5-911f-25ff7409a54a.vsidx


BIN
.vs/FellTrees/FileContentIndex/f8ffb7ef-b04c-4502-9d97-25d237586cef.vsidx


BIN
.vs/FellTrees/v17/.wsuo


+ 37 - 0
.vs/FellTrees/v17/DocumentLayout.backup.json

@@ -0,0 +1,37 @@
+{
+  "Version": 1,
+  "WorkspaceRootPath": "D:\\Projects\\Cocos\\FellTrees\\",
+  "Documents": [
+    {
+      "AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|D:\\Projects\\Cocos\\FellTrees\\assets\\Scripts\\Leaves.ts||{3B902123-F8A7-4915-9F01-361F908088D0}",
+      "RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:assets\\Scripts\\Leaves.ts||{3B902123-F8A7-4915-9F01-361F908088D0}"
+    }
+  ],
+  "DocumentGroupContainers": [
+    {
+      "Orientation": 0,
+      "VerticalTabListWidth": 256,
+      "DocumentGroups": [
+        {
+          "DockedWidth": 200,
+          "SelectedChildIndex": 0,
+          "Children": [
+            {
+              "$type": "Document",
+              "DocumentIndex": 0,
+              "Title": "Leaves.ts",
+              "DocumentMoniker": "D:\\Projects\\Cocos\\FellTrees\\assets\\Scripts\\Leaves.ts",
+              "RelativeDocumentMoniker": "assets\\Scripts\\Leaves.ts",
+              "ToolTip": "D:\\Projects\\Cocos\\FellTrees\\assets\\Scripts\\Leaves.ts*",
+              "RelativeToolTip": "assets\\Scripts\\Leaves.ts*",
+              "ViewState": "AgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==",
+              "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.003213|",
+              "WhenOpened": "2025-10-24T07:49:19.856Z",
+              "EditorCaption": ""
+            }
+          ]
+        }
+      ]
+    }
+  ]
+}

+ 37 - 0
.vs/FellTrees/v17/DocumentLayout.json

@@ -0,0 +1,37 @@
+{
+  "Version": 1,
+  "WorkspaceRootPath": "D:\\Projects\\Cocos\\FellTrees\\",
+  "Documents": [
+    {
+      "AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|D:\\Projects\\Cocos\\FellTrees\\assets\\Scripts\\Tree.ts||{3B902123-F8A7-4915-9F01-361F908088D0}",
+      "RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:assets\\Scripts\\Tree.ts||{3B902123-F8A7-4915-9F01-361F908088D0}"
+    }
+  ],
+  "DocumentGroupContainers": [
+    {
+      "Orientation": 0,
+      "VerticalTabListWidth": 256,
+      "DocumentGroups": [
+        {
+          "DockedWidth": 200,
+          "SelectedChildIndex": 0,
+          "Children": [
+            {
+              "$type": "Document",
+              "DocumentIndex": 0,
+              "Title": "Tree.ts",
+              "DocumentMoniker": "D:\\Projects\\Cocos\\FellTrees\\assets\\Scripts\\Tree.ts",
+              "RelativeDocumentMoniker": "assets\\Scripts\\Tree.ts",
+              "ToolTip": "D:\\Projects\\Cocos\\FellTrees\\assets\\Scripts\\Tree.ts",
+              "RelativeToolTip": "assets\\Scripts\\Tree.ts",
+              "ViewState": "AgIAAAAAAAAAAAAAAAAAABAAAAAMAAAAAAAAAA==",
+              "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.003213|",
+              "WhenOpened": "2025-10-24T07:51:12.633Z",
+              "EditorCaption": ""
+            }
+          ]
+        }
+      ]
+    }
+  ]
+}

+ 3 - 0
.vs/ProjectSettings.json

@@ -0,0 +1,3 @@
+{
+  "CurrentProjectSetting": null
+}

+ 6 - 0
.vs/VSWorkspaceState.json

@@ -0,0 +1,6 @@
+{
+  "ExpandedNodes": [
+    ""
+  ],
+  "PreviewInSolutionExplorer": false
+}

BIN
.vs/slnx.sqlite


+ 17 - 0
assets/Anims/LeavesFall.anim

@@ -0,0 +1,17 @@
+{
+  "__type__": "cc.AnimationClip",
+  "_name": "",
+  "_objFlags": 0,
+  "_native": "",
+  "sample": 60,
+  "speed": 1,
+  "wrapMode": 1,
+  "events": [],
+  "_duration": 0,
+  "_keys": [],
+  "_stepness": 0,
+  "curveDatas": {},
+  "_curves": [],
+  "_commonTargets": [],
+  "_hash": 0
+}

+ 13 - 0
assets/Anims/LeavesFall.anim.meta

@@ -0,0 +1,13 @@
+{
+  "ver": "2.0.4",
+  "importer": "animation-clip",
+  "imported": true,
+  "uuid": "1cd78dd6-6b23-4864-b6ef-5408d9deb425",
+  "files": [
+    ".bin"
+  ],
+  "subMetas": {},
+  "userData": {
+    "name": "LeavesFall"
+  }
+}

+ 348 - 0
assets/Anims/Shake.anim

@@ -0,0 +1,348 @@
+[
+  {
+    "__type__": "cc.AnimationClip",
+    "_name": "Shake",
+    "_objFlags": 0,
+    "__editorExtras__": {
+      "embeddedPlayerGroups": []
+    },
+    "_native": "",
+    "sample": 60,
+    "speed": 1,
+    "wrapMode": 1,
+    "enableTrsBlending": false,
+    "_duration": 0.15,
+    "_hash": 500763545,
+    "_tracks": [
+      {
+        "__id__": 1
+      }
+    ],
+    "_exoticAnimation": null,
+    "_events": [],
+    "_embeddedPlayers": [],
+    "_additiveSettings": {
+      "__id__": 11
+    },
+    "_auxiliaryCurveEntries": []
+  },
+  {
+    "__type__": "cc.animation.VectorTrack",
+    "_binding": {
+      "__type__": "cc.animation.TrackBinding",
+      "path": {
+        "__id__": 2
+      },
+      "proxy": null
+    },
+    "_channels": [
+      {
+        "__id__": 3
+      },
+      {
+        "__id__": 5
+      },
+      {
+        "__id__": 7
+      },
+      {
+        "__id__": 9
+      }
+    ],
+    "_nComponents": 3
+  },
+  {
+    "__type__": "cc.animation.TrackPath",
+    "_paths": [
+      "position"
+    ]
+  },
+  {
+    "__type__": "cc.animation.Channel",
+    "_curve": {
+      "__id__": 4
+    }
+  },
+  {
+    "__type__": "cc.RealCurve",
+    "_times": [
+      0.016666666666666666,
+      0.05,
+      0.08333333333333333,
+      0.11666666666666667,
+      0.15
+    ],
+    "_values": [
+      {
+        "__type__": "cc.RealKeyframeValue",
+        "interpolationMode": 0,
+        "tangentWeightMode": 0,
+        "value": -71.286,
+        "rightTangent": 0,
+        "rightTangentWeight": 1,
+        "leftTangent": 0,
+        "leftTangentWeight": 1,
+        "easingMethod": 0,
+        "__editorExtras__": {
+          "tangentMode": 0
+        }
+      },
+      {
+        "__type__": "cc.RealKeyframeValue",
+        "interpolationMode": 0,
+        "tangentWeightMode": 0,
+        "value": -107.521,
+        "rightTangent": 0,
+        "rightTangentWeight": 1,
+        "leftTangent": 0,
+        "leftTangentWeight": 1,
+        "easingMethod": 0,
+        "__editorExtras__": {
+          "tangentMode": 0
+        }
+      },
+      {
+        "__type__": "cc.RealKeyframeValue",
+        "interpolationMode": 0,
+        "tangentWeightMode": 0,
+        "value": -67.992,
+        "rightTangent": 0,
+        "rightTangentWeight": 1,
+        "leftTangent": 0,
+        "leftTangentWeight": 1,
+        "easingMethod": 0,
+        "__editorExtras__": {
+          "tangentMode": 0
+        }
+      },
+      {
+        "__type__": "cc.RealKeyframeValue",
+        "interpolationMode": 0,
+        "tangentWeightMode": 0,
+        "value": -166.814,
+        "rightTangent": 0,
+        "rightTangentWeight": 1,
+        "leftTangent": 0,
+        "leftTangentWeight": 1,
+        "easingMethod": 0,
+        "__editorExtras__": {
+          "tangentMode": 0
+        }
+      },
+      {
+        "__type__": "cc.RealKeyframeValue",
+        "interpolationMode": 0,
+        "tangentWeightMode": 0,
+        "value": -71.286,
+        "rightTangent": 0,
+        "rightTangentWeight": 1,
+        "leftTangent": 0,
+        "leftTangentWeight": 1,
+        "easingMethod": 0,
+        "__editorExtras__": {
+          "tangentMode": 0
+        }
+      }
+    ],
+    "preExtrapolation": 1,
+    "postExtrapolation": 1
+  },
+  {
+    "__type__": "cc.animation.Channel",
+    "_curve": {
+      "__id__": 6
+    }
+  },
+  {
+    "__type__": "cc.RealCurve",
+    "_times": [
+      0.016666666666666666,
+      0.05,
+      0.08333333333333333,
+      0.11666666666666667,
+      0.15
+    ],
+    "_values": [
+      {
+        "__type__": "cc.RealKeyframeValue",
+        "interpolationMode": 0,
+        "tangentWeightMode": 0,
+        "value": 424.393,
+        "rightTangent": 0,
+        "rightTangentWeight": 1,
+        "leftTangent": 0,
+        "leftTangentWeight": 1,
+        "easingMethod": 0,
+        "__editorExtras__": {
+          "tangentMode": 0
+        }
+      },
+      {
+        "__type__": "cc.RealKeyframeValue",
+        "interpolationMode": 0,
+        "tangentWeightMode": 0,
+        "value": 424.393,
+        "rightTangent": 0,
+        "rightTangentWeight": 1,
+        "leftTangent": 0,
+        "leftTangentWeight": 1,
+        "easingMethod": 0,
+        "__editorExtras__": {
+          "tangentMode": 0
+        }
+      },
+      {
+        "__type__": "cc.RealKeyframeValue",
+        "interpolationMode": 0,
+        "tangentWeightMode": 0,
+        "value": 424.393,
+        "rightTangent": 0,
+        "rightTangentWeight": 1,
+        "leftTangent": 0,
+        "leftTangentWeight": 1,
+        "easingMethod": 0,
+        "__editorExtras__": {
+          "tangentMode": 0
+        }
+      },
+      {
+        "__type__": "cc.RealKeyframeValue",
+        "interpolationMode": 0,
+        "tangentWeightMode": 0,
+        "value": 424.393,
+        "rightTangent": 0,
+        "rightTangentWeight": 1,
+        "leftTangent": 0,
+        "leftTangentWeight": 1,
+        "easingMethod": 0,
+        "__editorExtras__": {
+          "tangentMode": 0
+        }
+      },
+      {
+        "__type__": "cc.RealKeyframeValue",
+        "interpolationMode": 0,
+        "tangentWeightMode": 0,
+        "value": 424.393,
+        "rightTangent": 0,
+        "rightTangentWeight": 1,
+        "leftTangent": 0,
+        "leftTangentWeight": 1,
+        "easingMethod": 0,
+        "__editorExtras__": {
+          "tangentMode": 0
+        }
+      }
+    ],
+    "preExtrapolation": 1,
+    "postExtrapolation": 1
+  },
+  {
+    "__type__": "cc.animation.Channel",
+    "_curve": {
+      "__id__": 8
+    }
+  },
+  {
+    "__type__": "cc.RealCurve",
+    "_times": [
+      0.016666666666666666,
+      0.05,
+      0.08333333333333333,
+      0.11666666666666667,
+      0.15
+    ],
+    "_values": [
+      {
+        "__type__": "cc.RealKeyframeValue",
+        "interpolationMode": 0,
+        "tangentWeightMode": 0,
+        "value": 0,
+        "rightTangent": 0,
+        "rightTangentWeight": 1,
+        "leftTangent": 0,
+        "leftTangentWeight": 1,
+        "easingMethod": 0,
+        "__editorExtras__": {
+          "tangentMode": 0
+        }
+      },
+      {
+        "__type__": "cc.RealKeyframeValue",
+        "interpolationMode": 0,
+        "tangentWeightMode": 0,
+        "value": 0,
+        "rightTangent": 0,
+        "rightTangentWeight": 1,
+        "leftTangent": 0,
+        "leftTangentWeight": 1,
+        "easingMethod": 0,
+        "__editorExtras__": {
+          "tangentMode": 0
+        }
+      },
+      {
+        "__type__": "cc.RealKeyframeValue",
+        "interpolationMode": 0,
+        "tangentWeightMode": 0,
+        "value": 0,
+        "rightTangent": 0,
+        "rightTangentWeight": 1,
+        "leftTangent": 0,
+        "leftTangentWeight": 1,
+        "easingMethod": 0,
+        "__editorExtras__": {
+          "tangentMode": 0
+        }
+      },
+      {
+        "__type__": "cc.RealKeyframeValue",
+        "interpolationMode": 0,
+        "tangentWeightMode": 0,
+        "value": 0,
+        "rightTangent": 0,
+        "rightTangentWeight": 1,
+        "leftTangent": 0,
+        "leftTangentWeight": 1,
+        "easingMethod": 0,
+        "__editorExtras__": {
+          "tangentMode": 0
+        }
+      },
+      {
+        "__type__": "cc.RealKeyframeValue",
+        "interpolationMode": 0,
+        "tangentWeightMode": 0,
+        "value": 0,
+        "rightTangent": 0,
+        "rightTangentWeight": 1,
+        "leftTangent": 0,
+        "leftTangentWeight": 1,
+        "easingMethod": 0,
+        "__editorExtras__": {
+          "tangentMode": 0
+        }
+      }
+    ],
+    "preExtrapolation": 1,
+    "postExtrapolation": 1
+  },
+  {
+    "__type__": "cc.animation.Channel",
+    "_curve": {
+      "__id__": 10
+    }
+  },
+  {
+    "__type__": "cc.RealCurve",
+    "_times": [],
+    "_values": [],
+    "preExtrapolation": 1,
+    "postExtrapolation": 1
+  },
+  {
+    "__type__": "cc.AnimationClipAdditiveSettings",
+    "enabled": false,
+    "refClip": null
+  }
+]

+ 13 - 0
assets/Anims/Shake.anim.meta

@@ -0,0 +1,13 @@
+{
+  "ver": "2.0.4",
+  "importer": "animation-clip",
+  "imported": true,
+  "uuid": "44526ea8-d681-4436-9370-30506086dac3",
+  "files": [
+    ".bin"
+  ],
+  "subMetas": {},
+  "userData": {
+    "name": "Shake"
+  }
+}

+ 491 - 91
assets/Scenes/Main.scene

@@ -32,7 +32,7 @@
     "_active": true,
     "_components": [],
     "_prefab": {
-      "__id__": 53
+      "__id__": 64
     },
     "_lpos": {
       "__type__": "cc.Vec3",
@@ -63,7 +63,7 @@
     },
     "autoReleaseAssets": false,
     "_globals": {
-      "__id__": 54
+      "__id__": 65
     },
     "_id": "f3059a60-1abe-43ea-84c0-e11237d95b57"
   },
@@ -260,19 +260,22 @@
         "__id__": 29
       },
       {
-        "__id__": 33
+        "__id__": 34
+      },
+      {
+        "__id__": 53
       }
     ],
     "_active": true,
     "_components": [
       {
-        "__id__": 50
+        "__id__": 61
       },
       {
-        "__id__": 51
+        "__id__": 62
       },
       {
-        "__id__": 52
+        "__id__": 63
       }
     ],
     "_prefab": null,
@@ -364,7 +367,7 @@
     "_priority": 0,
     "_fov": 45,
     "_fovAxis": 0,
-    "_orthoHeight": 496.11034482758623,
+    "_orthoHeight": 360.00000000000006,
     "_near": 0,
     "_far": 2000,
     "_color": {
@@ -1001,6 +1004,9 @@
       },
       {
         "__id__": 32
+      },
+      {
+        "__id__": 33
       }
     ],
     "_prefab": null,
@@ -1106,6 +1112,29 @@
     "__prefab": null,
     "_id": "25ppkOPvFOR44RO3KRBBSd"
   },
+  {
+    "__type__": "cc.Animation",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 29
+    },
+    "_enabled": true,
+    "__prefab": null,
+    "playOnLoad": false,
+    "_clips": [
+      {
+        "__uuid__": "44526ea8-d681-4436-9370-30506086dac3",
+        "__expectedType__": "cc.AnimationClip"
+      }
+    ],
+    "_defaultClip": {
+      "__uuid__": "44526ea8-d681-4436-9370-30506086dac3",
+      "__expectedType__": "cc.AnimationClip"
+    },
+    "_id": "8dtSB0VjRJLrlWLZyHqyCt"
+  },
   {
     "__type__": "cc.Node",
     "_name": "Leaves",
@@ -1116,25 +1145,31 @@
     },
     "_children": [
       {
-        "__id__": 34
+        "__id__": 35
       },
       {
-        "__id__": 37
+        "__id__": 38
       },
       {
-        "__id__": 40
+        "__id__": 41
       },
       {
-        "__id__": 43
+        "__id__": 44
       },
       {
-        "__id__": 46
+        "__id__": 47
       }
     ],
     "_active": true,
     "_components": [
       {
-        "__id__": 49
+        "__id__": 50
+      },
+      {
+        "__id__": 51
+      },
+      {
+        "__id__": 52
       }
     ],
     "_prefab": null,
@@ -1169,26 +1204,26 @@
   },
   {
     "__type__": "cc.Node",
-    "_name": "Leaf5",
+    "_name": "Lf1",
     "_objFlags": 0,
     "__editorExtras__": {},
     "_parent": {
-      "__id__": 33
+      "__id__": 34
     },
     "_children": [],
-    "_active": true,
+    "_active": false,
     "_components": [
       {
-        "__id__": 35
+        "__id__": 36
       },
       {
-        "__id__": 36
+        "__id__": 37
       }
     ],
     "_prefab": null,
     "_lpos": {
       "__type__": "cc.Vec3",
-      "x": -1351.18,
+      "x": 0,
       "y": 0,
       "z": 0
     },
@@ -1213,7 +1248,7 @@
       "y": 0,
       "z": 0
     },
-    "_id": "e6/tWKMx1CbZBzYyJHcCFg"
+    "_id": "5bFhrDHF9NUabtxuWf/2kH"
   },
   {
     "__type__": "cc.UITransform",
@@ -1221,21 +1256,21 @@
     "_objFlags": 0,
     "__editorExtras__": {},
     "node": {
-      "__id__": 34
+      "__id__": 35
     },
     "_enabled": true,
     "__prefab": null,
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 2095,
-      "height": 1208
+      "width": 3310,
+      "height": 2252
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
       "x": 0.5,
       "y": 0.5
     },
-    "_id": "aekCbUAvBBopvAyqaREBwM"
+    "_id": "672lLlVVNKBYK0NyolnKtc"
   },
   {
     "__type__": "cc.Sprite",
@@ -1243,7 +1278,7 @@
     "_objFlags": 0,
     "__editorExtras__": {},
     "node": {
-      "__id__": 34
+      "__id__": 35
     },
     "_enabled": true,
     "__prefab": null,
@@ -1258,7 +1293,7 @@
       "a": 255
     },
     "_spriteFrame": {
-      "__uuid__": "e5deb1bd-8822-4ab1-b42e-d5423f990be7@f9941",
+      "__uuid__": "136c56d8-642e-484b-add8-2fce4eb38a58@f9941",
       "__expectedType__": "cc.SpriteFrame"
     },
     "_type": 0,
@@ -1274,31 +1309,31 @@
     "_isTrimmedMode": true,
     "_useGrayscale": false,
     "_atlas": null,
-    "_id": "c7svei5CZFuqjcbLEQNJq3"
+    "_id": "ecXxK0HUJOSIVSC5KWDEn6"
   },
   {
     "__type__": "cc.Node",
-    "_name": "Leaf4",
+    "_name": "Lf2",
     "_objFlags": 0,
     "__editorExtras__": {},
     "_parent": {
-      "__id__": 33
+      "__id__": 34
     },
     "_children": [],
-    "_active": true,
+    "_active": false,
     "_components": [
       {
-        "__id__": 38
+        "__id__": 39
       },
       {
-        "__id__": 39
+        "__id__": 40
       }
     ],
     "_prefab": null,
     "_lpos": {
       "__type__": "cc.Vec3",
-      "x": 2092.14,
-      "y": 5796.98,
+      "x": 0,
+      "y": 0,
       "z": 0
     },
     "_lrot": {
@@ -1322,7 +1357,7 @@
       "y": 0,
       "z": 0
     },
-    "_id": "98qYri1kdK3Zwv2ZxZkcJ2"
+    "_id": "6dbWhhsE1NyYgx3+it5bJX"
   },
   {
     "__type__": "cc.UITransform",
@@ -1330,21 +1365,21 @@
     "_objFlags": 0,
     "__editorExtras__": {},
     "node": {
-      "__id__": 37
+      "__id__": 38
     },
     "_enabled": true,
     "__prefab": null,
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 2936,
-      "height": 2540
+      "width": 2479,
+      "height": 3475
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
       "x": 0.5,
       "y": 0.5
     },
-    "_id": "2bSkKbxe1Ij7tksH50JCX1"
+    "_id": "d5vTajiJ5MrYkaupnH7sAQ"
   },
   {
     "__type__": "cc.Sprite",
@@ -1352,7 +1387,7 @@
     "_objFlags": 0,
     "__editorExtras__": {},
     "node": {
-      "__id__": 37
+      "__id__": 38
     },
     "_enabled": true,
     "__prefab": null,
@@ -1367,7 +1402,7 @@
       "a": 255
     },
     "_spriteFrame": {
-      "__uuid__": "11b3c9fe-503d-46ea-80c7-1ce82a030b57@f9941",
+      "__uuid__": "1dda34a0-a775-4f22-89c4-4cb4db372c58@f9941",
       "__expectedType__": "cc.SpriteFrame"
     },
     "_type": 0,
@@ -1383,31 +1418,31 @@
     "_isTrimmedMode": true,
     "_useGrayscale": false,
     "_atlas": null,
-    "_id": "89CA4E01FC3YIzFBhLxuCL"
+    "_id": "f2zolwbOtGcpd3Ym7U2Yut"
   },
   {
     "__type__": "cc.Node",
-    "_name": "Leaf3",
+    "_name": "Lf3",
     "_objFlags": 0,
     "__editorExtras__": {},
     "_parent": {
-      "__id__": 33
+      "__id__": 34
     },
     "_children": [],
-    "_active": true,
+    "_active": false,
     "_components": [
       {
-        "__id__": 41
+        "__id__": 42
       },
       {
-        "__id__": 42
+        "__id__": 43
       }
     ],
     "_prefab": null,
     "_lpos": {
       "__type__": "cc.Vec3",
       "x": 0,
-      "y": 2920.28,
+      "y": 0,
       "z": 0
     },
     "_lrot": {
@@ -1431,7 +1466,7 @@
       "y": 0,
       "z": 0
     },
-    "_id": "d8m7GfY6JFmIcxgEF/Zqvh"
+    "_id": "d4XU89CNlGfbsuZfsSkjAm"
   },
   {
     "__type__": "cc.UITransform",
@@ -1439,7 +1474,7 @@
     "_objFlags": 0,
     "__editorExtras__": {},
     "node": {
-      "__id__": 40
+      "__id__": 41
     },
     "_enabled": true,
     "__prefab": null,
@@ -1453,7 +1488,7 @@
       "x": 0.5,
       "y": 0.5
     },
-    "_id": "66K0Ox0M5LzLnU/X5NSIjU"
+    "_id": "44MFcWuc1E4aCRM3PSUgat"
   },
   {
     "__type__": "cc.Sprite",
@@ -1461,7 +1496,7 @@
     "_objFlags": 0,
     "__editorExtras__": {},
     "node": {
-      "__id__": 40
+      "__id__": 41
     },
     "_enabled": true,
     "__prefab": null,
@@ -1492,31 +1527,31 @@
     "_isTrimmedMode": true,
     "_useGrayscale": false,
     "_atlas": null,
-    "_id": "f9pS/2RqpKuakQS93B7MpL"
+    "_id": "001dA3JjpElaA3DXEc0mvK"
   },
   {
     "__type__": "cc.Node",
-    "_name": "Leaf2",
+    "_name": "Lf4",
     "_objFlags": 0,
     "__editorExtras__": {},
     "_parent": {
-      "__id__": 33
+      "__id__": 34
     },
     "_children": [],
-    "_active": true,
+    "_active": false,
     "_components": [
       {
-        "__id__": 44
+        "__id__": 45
       },
       {
-        "__id__": 45
+        "__id__": 46
       }
     ],
     "_prefab": null,
     "_lpos": {
       "__type__": "cc.Vec3",
-      "x": 1351.18,
-      "y": -2048.56,
+      "x": 0,
+      "y": 0,
       "z": 0
     },
     "_lrot": {
@@ -1540,7 +1575,7 @@
       "y": 0,
       "z": 0
     },
-    "_id": "0afW0M94pImodCsSSEG2yC"
+    "_id": "5a4tn93wxGarCnH3bWBnK7"
   },
   {
     "__type__": "cc.UITransform",
@@ -1548,21 +1583,21 @@
     "_objFlags": 0,
     "__editorExtras__": {},
     "node": {
-      "__id__": 43
+      "__id__": 44
     },
     "_enabled": true,
     "__prefab": null,
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 2479,
-      "height": 3475
+      "width": 2936,
+      "height": 2540
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
       "x": 0.5,
       "y": 0.5
     },
-    "_id": "1e80swQTFGPo4pCfz0QXcF"
+    "_id": "d3p2ZBsNhML6v24w6pqXCR"
   },
   {
     "__type__": "cc.Sprite",
@@ -1570,7 +1605,7 @@
     "_objFlags": 0,
     "__editorExtras__": {},
     "node": {
-      "__id__": 43
+      "__id__": 44
     },
     "_enabled": true,
     "__prefab": null,
@@ -1585,7 +1620,7 @@
       "a": 255
     },
     "_spriteFrame": {
-      "__uuid__": "1dda34a0-a775-4f22-89c4-4cb4db372c58@f9941",
+      "__uuid__": "11b3c9fe-503d-46ea-80c7-1ce82a030b57@f9941",
       "__expectedType__": "cc.SpriteFrame"
     },
     "_type": 0,
@@ -1601,30 +1636,30 @@
     "_isTrimmedMode": true,
     "_useGrayscale": false,
     "_atlas": null,
-    "_id": "b4Pt81eOdJkItfXCnvM30n"
+    "_id": "25eCejQ1JAVpV7DUT2EPGz"
   },
   {
     "__type__": "cc.Node",
-    "_name": "Leaf1",
+    "_name": "Lf5",
     "_objFlags": 0,
     "__editorExtras__": {},
     "_parent": {
-      "__id__": 33
+      "__id__": 34
     },
     "_children": [],
-    "_active": true,
+    "_active": false,
     "_components": [
       {
-        "__id__": 47
+        "__id__": 48
       },
       {
-        "__id__": 48
+        "__id__": 49
       }
     ],
     "_prefab": null,
     "_lpos": {
       "__type__": "cc.Vec3",
-      "x": 1394.76,
+      "x": 0,
       "y": 0,
       "z": 0
     },
@@ -1649,7 +1684,7 @@
       "y": 0,
       "z": 0
     },
-    "_id": "d5sZygbtlMwbQOEptlpiv0"
+    "_id": "25qh31Am5GwrvhN8w0V6i7"
   },
   {
     "__type__": "cc.UITransform",
@@ -1657,21 +1692,21 @@
     "_objFlags": 0,
     "__editorExtras__": {},
     "node": {
-      "__id__": 46
+      "__id__": 47
     },
     "_enabled": true,
     "__prefab": null,
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 3310,
-      "height": 2252
+      "width": 2095,
+      "height": 1208
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
       "x": 0.5,
       "y": 0.5
     },
-    "_id": "ffWj5gGV9GTqYlKd4vd39m"
+    "_id": "d5zr0DuapBlIgNX7o44llw"
   },
   {
     "__type__": "cc.Sprite",
@@ -1679,7 +1714,7 @@
     "_objFlags": 0,
     "__editorExtras__": {},
     "node": {
-      "__id__": 46
+      "__id__": 47
     },
     "_enabled": true,
     "__prefab": null,
@@ -1694,7 +1729,7 @@
       "a": 255
     },
     "_spriteFrame": {
-      "__uuid__": "136c56d8-642e-484b-add8-2fce4eb38a58@f9941",
+      "__uuid__": "e5deb1bd-8822-4ab1-b42e-d5423f990be7@f9941",
       "__expectedType__": "cc.SpriteFrame"
     },
     "_type": 0,
@@ -1710,7 +1745,7 @@
     "_isTrimmedMode": true,
     "_useGrayscale": false,
     "_atlas": null,
-    "_id": "78z5ryA3NOSIOkp8oqzyVt"
+    "_id": "b08asXan9JpK6wA9wYITyg"
   },
   {
     "__type__": "cc.UITransform",
@@ -1718,7 +1753,7 @@
     "_objFlags": 0,
     "__editorExtras__": {},
     "node": {
-      "__id__": 33
+      "__id__": 34
     },
     "_enabled": true,
     "__prefab": null,
@@ -1734,6 +1769,371 @@
     },
     "_id": "72U1W5r+5BHrqdcsfHMR66"
   },
+  {
+    "__type__": "1e244MvMPxI75ONtKqUYs2Q",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 34
+    },
+    "_enabled": true,
+    "__prefab": null,
+    "_id": "35T+rLwT1AGrkxP19Uu0g2"
+  },
+  {
+    "__type__": "cc.Animation",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 34
+    },
+    "_enabled": true,
+    "__prefab": null,
+    "playOnLoad": false,
+    "_clips": [
+      {
+        "__uuid__": "1cd78dd6-6b23-4864-b6ef-5408d9deb425",
+        "__expectedType__": "cc.AnimationClip"
+      },
+      {
+        "__uuid__": "44526ea8-d681-4436-9370-30506086dac3",
+        "__expectedType__": "cc.AnimationClip"
+      }
+    ],
+    "_defaultClip": {
+      "__uuid__": "1cd78dd6-6b23-4864-b6ef-5408d9deb425",
+      "__expectedType__": "cc.AnimationClip"
+    },
+    "_id": "3aFOjzwAJHYLT3sWvuCks2"
+  },
+  {
+    "__type__": "cc.Node",
+    "_name": "Button",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "_parent": {
+      "__id__": 8
+    },
+    "_children": [
+      {
+        "__id__": 54
+      }
+    ],
+    "_active": true,
+    "_components": [
+      {
+        "__id__": 57
+      },
+      {
+        "__id__": 58
+      },
+      {
+        "__id__": 59
+      }
+    ],
+    "_prefab": null,
+    "_lpos": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": -266.821,
+      "z": 0
+    },
+    "_lrot": {
+      "__type__": "cc.Quat",
+      "x": 0,
+      "y": 0,
+      "z": 0,
+      "w": 1
+    },
+    "_lscale": {
+      "__type__": "cc.Vec3",
+      "x": 1,
+      "y": 1,
+      "z": 1
+    },
+    "_mobility": 0,
+    "_layer": 33554432,
+    "_euler": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_id": "69gl3d96hCvrntfSrrdRD2"
+  },
+  {
+    "__type__": "cc.Node",
+    "_name": "Label",
+    "_objFlags": 512,
+    "__editorExtras__": {},
+    "_parent": {
+      "__id__": 53
+    },
+    "_children": [],
+    "_active": true,
+    "_components": [
+      {
+        "__id__": 55
+      },
+      {
+        "__id__": 56
+      }
+    ],
+    "_prefab": null,
+    "_lpos": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_lrot": {
+      "__type__": "cc.Quat",
+      "x": 0,
+      "y": 0,
+      "z": 0,
+      "w": 1
+    },
+    "_lscale": {
+      "__type__": "cc.Vec3",
+      "x": 1,
+      "y": 1,
+      "z": 1
+    },
+    "_mobility": 0,
+    "_layer": 33554432,
+    "_euler": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_id": "10NISC1LFG0JUS6aH84IBL"
+  },
+  {
+    "__type__": "cc.UITransform",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 54
+    },
+    "_enabled": true,
+    "__prefab": null,
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 100,
+      "height": 40
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0.5
+    },
+    "_id": "abZfZobJ5NlJ/y+BRoohNn"
+  },
+  {
+    "__type__": "cc.Label",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 54
+    },
+    "_enabled": true,
+    "__prefab": null,
+    "_customMaterial": null,
+    "_srcBlendFactor": 2,
+    "_dstBlendFactor": 4,
+    "_color": {
+      "__type__": "cc.Color",
+      "r": 0,
+      "g": 0,
+      "b": 0,
+      "a": 255
+    },
+    "_string": "button",
+    "_horizontalAlign": 1,
+    "_verticalAlign": 1,
+    "_actualFontSize": 23.055555555555554,
+    "_fontSize": 20,
+    "_fontFamily": "Arial",
+    "_lineHeight": 40,
+    "_overflow": 1,
+    "_enableWrapText": false,
+    "_font": null,
+    "_isSystemFontUsed": true,
+    "_spacingX": 0,
+    "_isItalic": false,
+    "_isBold": false,
+    "_isUnderline": false,
+    "_underlineHeight": 2,
+    "_cacheMode": 0,
+    "_enableOutline": false,
+    "_outlineColor": {
+      "__type__": "cc.Color",
+      "r": 0,
+      "g": 0,
+      "b": 0,
+      "a": 255
+    },
+    "_outlineWidth": 2,
+    "_enableShadow": false,
+    "_shadowColor": {
+      "__type__": "cc.Color",
+      "r": 0,
+      "g": 0,
+      "b": 0,
+      "a": 255
+    },
+    "_shadowOffset": {
+      "__type__": "cc.Vec2",
+      "x": 2,
+      "y": 2
+    },
+    "_shadowBlur": 2,
+    "_id": "bchchIk41L8J0deopfH8ep"
+  },
+  {
+    "__type__": "cc.UITransform",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 53
+    },
+    "_enabled": true,
+    "__prefab": null,
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 100,
+      "height": 40
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0.5
+    },
+    "_id": "ddTc81oilNz6DHUNxJdAqQ"
+  },
+  {
+    "__type__": "cc.Sprite",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 53
+    },
+    "_enabled": true,
+    "__prefab": null,
+    "_customMaterial": null,
+    "_srcBlendFactor": 2,
+    "_dstBlendFactor": 4,
+    "_color": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    },
+    "_spriteFrame": {
+      "__uuid__": "20835ba4-6145-4fbc-a58a-051ce700aa3e@f9941",
+      "__expectedType__": "cc.SpriteFrame"
+    },
+    "_type": 1,
+    "_fillType": 0,
+    "_sizeMode": 0,
+    "_fillCenter": {
+      "__type__": "cc.Vec2",
+      "x": 0,
+      "y": 0
+    },
+    "_fillStart": 0,
+    "_fillRange": 0,
+    "_isTrimmedMode": true,
+    "_useGrayscale": false,
+    "_atlas": null,
+    "_id": "13SrxQtRZGYLwmmHfDxsNU"
+  },
+  {
+    "__type__": "cc.Button",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 53
+    },
+    "_enabled": true,
+    "__prefab": null,
+    "clickEvents": [
+      {
+        "__id__": 60
+      }
+    ],
+    "_interactable": true,
+    "_transition": 2,
+    "_normalColor": {
+      "__type__": "cc.Color",
+      "r": 214,
+      "g": 214,
+      "b": 214,
+      "a": 255
+    },
+    "_hoverColor": {
+      "__type__": "cc.Color",
+      "r": 211,
+      "g": 211,
+      "b": 211,
+      "a": 255
+    },
+    "_pressedColor": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    },
+    "_disabledColor": {
+      "__type__": "cc.Color",
+      "r": 124,
+      "g": 124,
+      "b": 124,
+      "a": 255
+    },
+    "_normalSprite": {
+      "__uuid__": "20835ba4-6145-4fbc-a58a-051ce700aa3e@f9941",
+      "__expectedType__": "cc.SpriteFrame"
+    },
+    "_hoverSprite": {
+      "__uuid__": "20835ba4-6145-4fbc-a58a-051ce700aa3e@f9941",
+      "__expectedType__": "cc.SpriteFrame"
+    },
+    "_pressedSprite": {
+      "__uuid__": "544e49d6-3f05-4fa8-9a9e-091f98fc2ce8@f9941",
+      "__expectedType__": "cc.SpriteFrame"
+    },
+    "_disabledSprite": {
+      "__uuid__": "951249e0-9f16-456d-8b85-a6ca954da16b@f9941",
+      "__expectedType__": "cc.SpriteFrame"
+    },
+    "_duration": 0.1,
+    "_zoomScale": 1.2,
+    "_target": {
+      "__id__": 53
+    },
+    "_id": "84EhisvbVFPK+xrUcEk7zW"
+  },
+  {
+    "__type__": "cc.ClickEvent",
+    "target": {
+      "__id__": 29
+    },
+    "component": "",
+    "_componentId": "506e04voqJCOaHQg/eunxmG",
+    "handler": "shakeAni",
+    "customEventData": ""
+  },
   {
     "__type__": "cc.UITransform",
     "_name": "",
@@ -1813,28 +2213,28 @@
   {
     "__type__": "cc.SceneGlobals",
     "ambient": {
-      "__id__": 55
+      "__id__": 66
     },
     "shadows": {
-      "__id__": 56
+      "__id__": 67
     },
     "_skybox": {
-      "__id__": 57
+      "__id__": 68
     },
     "fog": {
-      "__id__": 58
+      "__id__": 69
     },
     "octree": {
-      "__id__": 59
+      "__id__": 70
     },
     "skin": {
-      "__id__": 60
+      "__id__": 71
     },
     "lightProbeInfo": {
-      "__id__": 61
+      "__id__": 72
     },
     "postSettings": {
-      "__id__": 62
+      "__id__": 73
     },
     "bakedWithStationaryMainLight": false,
     "bakedWithHighpLightmap": false

+ 14 - 0
assets/Scripts/Leaves.ts

@@ -0,0 +1,14 @@
+import { _decorator, Component, Node } from 'cc';
+const { ccclass, property } = _decorator;
+
+@ccclass('Leaves')
+export class Leaves extends Component {
+    start() {
+
+    }
+
+    update(deltaTime: number) {
+        
+    }
+}
+


+ 9 - 0
assets/Scripts/Leaves.ts.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "4.0.24",
+  "importer": "typescript",
+  "imported": true,
+  "uuid": "1e24432f-30fc-48ef-938d-b4aa9462cd90",
+  "files": [],
+  "subMetas": {},
+  "userData": {}
+}

+ 62 - 14
assets/Scripts/Tree.ts

@@ -1,14 +1,62 @@
-import { _decorator, Component, Node } from 'cc';
-const { ccclass, property } = _decorator;
-
-@ccclass('Tree')
-export class Tree extends Component {
-    start() {
-
-    }
-
-    update(deltaTime: number) {
-        
-    }
-}
-

+import { _decorator, Component, Node, Animation} from 'cc';
+const { ccclass, property } = _decorator;
+
+@ccclass('Tree')
+export class Tree extends Component {
+
+     public animationComp: Animation | null = null;
+
+    start() {
+
+    // 获取当前节点上的 Animation 组件
+        this.animationComp = this.node.getComponent(Animation);
+        if (!this.animationComp) {
+            console.error("当前节点没有 Animation 组件!");
+            return;
+        } 
+        else
+        {
+             console.log("Animation Loaded");
+        }
+    }
+
+    update(deltaTime: number) {
+        
+    }
+
+    public shakeAni()
+    {
+            // 示例:根据动画名称获取剪辑并播放
+        const targetClipName = "Shake"; // 替换为你的动画剪辑名称
+        const targetClip = this.getClipByName(targetClipName);
+        
+         if (targetClip) {
+            console.log(`Found anim clip:${targetClipName},start play`);
+            this.animationComp.play(targetClipName); // 直接用名称播放,或用剪辑实例播放
+            // 也可以通过剪辑实例获取更多信息,例如时长
+            console.log(`Duration:${targetClip.duration} second`);
+        } else {
+            console.error(`Not found ${targetClipName} ani clip!`);
+        }
+    }
+
+    /**
+     * 根据动画剪辑名称,从当前节点的 Animation 组件中查找剪辑
+     * @param clipName 动画剪辑的名称(区分大小写)
+     * @returns 找到的 AnimationClip 实例,或 null
+     */
+      private getClipByName(clipName: string): AnimationClip | null {
+        if (!this.animationComp) return null;
+
+        // 遍历 Animation 组件的 clips 数组
+        for (const clip of this.animationComp.clips) {
+            if (clip.name === clipName) {
+                return clip;
+            }
+        }
+
+        return null;
+    }
+}
+
+

+ 0 - 0
assets/Textures/Scenes/Leaf1.png → assets/Textures/Scenes/Lf1.png


+ 2 - 2
assets/Textures/Scenes/Leaf1.png.meta → assets/Textures/Scenes/Lf1.png.meta

@@ -11,7 +11,7 @@
     "6c48a": {
       "importer": "texture",
       "uuid": "136c56d8-642e-484b-add8-2fce4eb38a58@6c48a",
-      "displayName": "Leaf1",
+      "displayName": "Lf1",
       "id": "6c48a",
       "name": "texture",
       "userData": {
@@ -35,7 +35,7 @@
     "f9941": {
       "importer": "sprite-frame",
       "uuid": "136c56d8-642e-484b-add8-2fce4eb38a58@f9941",
-      "displayName": "Leaf1",
+      "displayName": "Lf1",
       "id": "f9941",
       "name": "spriteFrame",
       "userData": {

+ 0 - 0
assets/Textures/Scenes/Leaf2.png → assets/Textures/Scenes/Lf2.png


+ 2 - 2
assets/Textures/Scenes/Leaf2.png.meta → assets/Textures/Scenes/Lf2.png.meta

@@ -11,7 +11,7 @@
     "6c48a": {
       "importer": "texture",
       "uuid": "1dda34a0-a775-4f22-89c4-4cb4db372c58@6c48a",
-      "displayName": "Leaf2",
+      "displayName": "Lf2",
       "id": "6c48a",
       "name": "texture",
       "userData": {
@@ -35,7 +35,7 @@
     "f9941": {
       "importer": "sprite-frame",
       "uuid": "1dda34a0-a775-4f22-89c4-4cb4db372c58@f9941",
-      "displayName": "Leaf2",
+      "displayName": "Lf2",
       "id": "f9941",
       "name": "spriteFrame",
       "userData": {

+ 0 - 0
assets/Textures/Scenes/Leaf3.png → assets/Textures/Scenes/Lf3.png


+ 2 - 2
assets/Textures/Scenes/Leaf3.png.meta → assets/Textures/Scenes/Lf3.png.meta

@@ -11,7 +11,7 @@
     "6c48a": {
       "importer": "texture",
       "uuid": "996042c9-1aa0-4e91-b5f7-01a28ad675a5@6c48a",
-      "displayName": "Leaf3",
+      "displayName": "Lf3",
       "id": "6c48a",
       "name": "texture",
       "userData": {
@@ -35,7 +35,7 @@
     "f9941": {
       "importer": "sprite-frame",
       "uuid": "996042c9-1aa0-4e91-b5f7-01a28ad675a5@f9941",
-      "displayName": "Leaf3",
+      "displayName": "Lf3",
       "id": "f9941",
       "name": "spriteFrame",
       "userData": {

+ 0 - 0
assets/Textures/Scenes/Leaf4.png → assets/Textures/Scenes/Lf4.png


+ 2 - 2
assets/Textures/Scenes/Leaf4.png.meta → assets/Textures/Scenes/Lf4.png.meta

@@ -11,7 +11,7 @@
     "6c48a": {
       "importer": "texture",
       "uuid": "11b3c9fe-503d-46ea-80c7-1ce82a030b57@6c48a",
-      "displayName": "Leaf4",
+      "displayName": "Lf4",
       "id": "6c48a",
       "name": "texture",
       "userData": {
@@ -35,7 +35,7 @@
     "f9941": {
       "importer": "sprite-frame",
       "uuid": "11b3c9fe-503d-46ea-80c7-1ce82a030b57@f9941",
-      "displayName": "Leaf4",
+      "displayName": "Lf4",
       "id": "f9941",
       "name": "spriteFrame",
       "userData": {

+ 0 - 0
assets/Textures/Scenes/Leaf5.png → assets/Textures/Scenes/Lf5.png


+ 2 - 2
assets/Textures/Scenes/Leaf5.png.meta → assets/Textures/Scenes/Lf5.png.meta

@@ -11,7 +11,7 @@
     "6c48a": {
       "importer": "texture",
       "uuid": "e5deb1bd-8822-4ab1-b42e-d5423f990be7@6c48a",
-      "displayName": "Leaf5",
+      "displayName": "Lf5",
       "id": "6c48a",
       "name": "texture",
       "userData": {
@@ -35,7 +35,7 @@
     "f9941": {
       "importer": "sprite-frame",
       "uuid": "e5deb1bd-8822-4ab1-b42e-d5423f990be7@f9941",
-      "displayName": "Leaf5",
+      "displayName": "Lf5",
       "id": "f9941",
       "name": "spriteFrame",
       "userData": {