perf: 优化奖励特效

This commit is contained in:
richarjiang
2025-09-29 17:44:52 +08:00
parent 553c4f0057
commit ac43ce51d7
9 changed files with 801 additions and 797 deletions

View File

@@ -41,12 +41,12 @@
"userData": { "userData": {
"trimThreshold": 1, "trimThreshold": 1,
"rotated": false, "rotated": false,
"offsetX": 27, "offsetX": 0,
"offsetY": 105, "offsetY": 0,
"trimX": 132, "trimX": 0,
"trimY": 260, "trimY": 0,
"width": 540, "width": 750,
"height": 604, "height": 1334,
"rawWidth": 750, "rawWidth": 750,
"rawHeight": 1334, "rawHeight": 1334,
"borderTop": 0, "borderTop": 0,
@@ -60,17 +60,17 @@
"meshType": 0, "meshType": 0,
"vertices": { "vertices": {
"rawPosition": [ "rawPosition": [
-270, -375,
-302, -667,
0, 0,
270, 375,
-302, -667,
0, 0,
-270, -375,
302, 667,
0, 0,
270, 375,
302, 667,
0 0
], ],
"indexes": [ "indexes": [
@@ -82,40 +82,40 @@
3 3
], ],
"uv": [ "uv": [
132, 0,
1074, 1334,
672, 750,
1074, 1334,
132, 0,
470, 0,
672, 750,
470 0
], ],
"nuv": [ "nuv": [
0.176, 0,
0.3523238380809595, 0,
0.896, 1,
0.3523238380809595, 0,
0.176, 0,
0.8050974512743628, 1,
0.896, 1,
0.8050974512743628 1
], ],
"minPos": [ "minPos": [
-270, -375,
-302, -667,
0 0
], ],
"maxPos": [ "maxPos": [
270, 375,
302, 667,
0 0
] ]
}, },
"isUuid": true, "isUuid": true,
"imageUuidOrDatabaseUri": "7f9ff6b4-469e-4cef-8422-8f8f93399f82@6c48a", "imageUuidOrDatabaseUri": "7f9ff6b4-469e-4cef-8422-8f8f93399f82@6c48a",
"atlasUuid": "", "atlasUuid": "",
"trimType": "auto" "trimType": "none"
}, },
"ver": "1.0.12", "ver": "1.0.12",
"imported": true, "imported": true,

View File

@@ -41,12 +41,12 @@
"userData": { "userData": {
"trimThreshold": 1, "trimThreshold": 1,
"rotated": false, "rotated": false,
"offsetX": 26.5, "offsetX": 0,
"offsetY": 102, "offsetY": 0,
"trimX": 128, "trimX": 0,
"trimY": 266, "trimY": 0,
"width": 547, "width": 750,
"height": 598, "height": 1334,
"rawWidth": 750, "rawWidth": 750,
"rawHeight": 1334, "rawHeight": 1334,
"borderTop": 0, "borderTop": 0,
@@ -60,17 +60,17 @@
"meshType": 0, "meshType": 0,
"vertices": { "vertices": {
"rawPosition": [ "rawPosition": [
-273.5, -375,
-299, -667,
0, 0,
273.5, 375,
-299, -667,
0, 0,
-273.5, -375,
299, 667,
0, 0,
273.5, 375,
299, 667,
0 0
], ],
"indexes": [ "indexes": [
@@ -82,40 +82,40 @@
3 3
], ],
"uv": [ "uv": [
128, 0,
1068, 1334,
675, 750,
1068, 1334,
128, 0,
470, 0,
675, 750,
470 0
], ],
"nuv": [ "nuv": [
0.17066666666666666, 0,
0.3523238380809595, 0,
0.9, 1,
0.3523238380809595, 0,
0.17066666666666666, 0,
0.800599700149925, 1,
0.9, 1,
0.800599700149925 1
], ],
"minPos": [ "minPos": [
-273.5, -375,
-299, -667,
0 0
], ],
"maxPos": [ "maxPos": [
273.5, 375,
299, 667,
0 0
] ]
}, },
"isUuid": true, "isUuid": true,
"imageUuidOrDatabaseUri": "1a8d83b8-2a7c-4237-a143-e993977ee029@6c48a", "imageUuidOrDatabaseUri": "1a8d83b8-2a7c-4237-a143-e993977ee029@6c48a",
"atlasUuid": "", "atlasUuid": "",
"trimType": "auto" "trimType": "none"
}, },
"ver": "1.0.12", "ver": "1.0.12",
"imported": true, "imported": true,

View File

@@ -41,12 +41,12 @@
"userData": { "userData": {
"trimThreshold": 1, "trimThreshold": 1,
"rotated": false, "rotated": false,
"offsetX": 20.5, "offsetX": 0,
"offsetY": 27.5, "offsetY": 0,
"trimX": 41, "trimX": 0,
"trimY": 155, "trimY": 0,
"width": 679, "width": 720,
"height": 915, "height": 1280,
"rawWidth": 720, "rawWidth": 720,
"rawHeight": 1280, "rawHeight": 1280,
"borderTop": 0, "borderTop": 0,
@@ -60,17 +60,17 @@
"meshType": 0, "meshType": 0,
"vertices": { "vertices": {
"rawPosition": [ "rawPosition": [
-339.5, -360,
-457.5, -640,
0, 0,
339.5, 360,
-457.5, -640,
0, 0,
-339.5, -360,
457.5, 640,
0, 0,
339.5, 360,
457.5, 640,
0 0
], ],
"indexes": [ "indexes": [
@@ -82,40 +82,40 @@
3 3
], ],
"uv": [ "uv": [
41, 0,
1125, 1280,
720, 720,
1125, 1280,
41, 0,
210, 0,
720, 720,
210 0
], ],
"nuv": [ "nuv": [
0.05694444444444444, 0,
0.1640625, 0,
1, 1,
0.1640625, 0,
0.05694444444444444, 0,
0.87890625,
1, 1,
0.87890625 1,
1
], ],
"minPos": [ "minPos": [
-339.5, -360,
-457.5, -640,
0 0
], ],
"maxPos": [ "maxPos": [
339.5, 360,
457.5, 640,
0 0
] ]
}, },
"isUuid": true, "isUuid": true,
"imageUuidOrDatabaseUri": "ef0a4723-ab8e-481f-9567-e9b2a1400181@6c48a", "imageUuidOrDatabaseUri": "ef0a4723-ab8e-481f-9567-e9b2a1400181@6c48a",
"atlasUuid": "", "atlasUuid": "",
"trimType": "auto" "trimType": "none"
}, },
"ver": "1.0.12", "ver": "1.0.12",
"imported": true, "imported": true,

View File

@@ -41,12 +41,12 @@
"userData": { "userData": {
"trimThreshold": 1, "trimThreshold": 1,
"rotated": false, "rotated": false,
"offsetX": 20.5, "offsetX": 0,
"offsetY": 27.5, "offsetY": 0,
"trimX": 41, "trimX": 0,
"trimY": 155, "trimY": 0,
"width": 679, "width": 720,
"height": 915, "height": 1280,
"rawWidth": 720, "rawWidth": 720,
"rawHeight": 1280, "rawHeight": 1280,
"borderTop": 0, "borderTop": 0,
@@ -60,17 +60,17 @@
"meshType": 0, "meshType": 0,
"vertices": { "vertices": {
"rawPosition": [ "rawPosition": [
-339.5, -360,
-457.5, -640,
0, 0,
339.5, 360,
-457.5, -640,
0, 0,
-339.5, -360,
457.5, 640,
0, 0,
339.5, 360,
457.5, 640,
0 0
], ],
"indexes": [ "indexes": [
@@ -82,40 +82,40 @@
3 3
], ],
"uv": [ "uv": [
41, 0,
1125, 1280,
720, 720,
1125, 1280,
41, 0,
210, 0,
720, 720,
210 0
], ],
"nuv": [ "nuv": [
0.05694444444444444, 0,
0.1640625, 0,
1, 1,
0.1640625, 0,
0.05694444444444444, 0,
0.87890625,
1, 1,
0.87890625 1,
1
], ],
"minPos": [ "minPos": [
-339.5, -360,
-457.5, -640,
0 0
], ],
"maxPos": [ "maxPos": [
339.5, 360,
457.5, 640,
0 0
] ]
}, },
"isUuid": true, "isUuid": true,
"imageUuidOrDatabaseUri": "3cbd569e-fed7-4498-87b4-11444552dfb5@6c48a", "imageUuidOrDatabaseUri": "3cbd569e-fed7-4498-87b4-11444552dfb5@6c48a",
"atlasUuid": "", "atlasUuid": "",
"trimType": "auto" "trimType": "none"
}, },
"ver": "1.0.12", "ver": "1.0.12",
"imported": true, "imported": true,

View File

@@ -41,12 +41,12 @@
"userData": { "userData": {
"trimThreshold": 1, "trimThreshold": 1,
"rotated": false, "rotated": false,
"offsetX": 20.5, "offsetX": 0,
"offsetY": 27.5, "offsetY": 0,
"trimX": 41, "trimX": 0,
"trimY": 155, "trimY": 0,
"width": 679, "width": 720,
"height": 915, "height": 1280,
"rawWidth": 720, "rawWidth": 720,
"rawHeight": 1280, "rawHeight": 1280,
"borderTop": 0, "borderTop": 0,
@@ -60,17 +60,17 @@
"meshType": 0, "meshType": 0,
"vertices": { "vertices": {
"rawPosition": [ "rawPosition": [
-339.5, -360,
-457.5, -640,
0, 0,
339.5, 360,
-457.5, -640,
0, 0,
-339.5, -360,
457.5, 640,
0, 0,
339.5, 360,
457.5, 640,
0 0
], ],
"indexes": [ "indexes": [
@@ -82,40 +82,40 @@
3 3
], ],
"uv": [ "uv": [
41, 0,
1125, 1280,
720, 720,
1125, 1280,
41, 0,
210, 0,
720, 720,
210 0
], ],
"nuv": [ "nuv": [
0.05694444444444444, 0,
0.1640625, 0,
1, 1,
0.1640625, 0,
0.05694444444444444, 0,
0.87890625,
1, 1,
0.87890625 1,
1
], ],
"minPos": [ "minPos": [
-339.5, -360,
-457.5, -640,
0 0
], ],
"maxPos": [ "maxPos": [
339.5, 360,
457.5, 640,
0 0
] ]
}, },
"isUuid": true, "isUuid": true,
"imageUuidOrDatabaseUri": "4d9cec20-8b34-46e7-9251-59272d42b227@6c48a", "imageUuidOrDatabaseUri": "4d9cec20-8b34-46e7-9251-59272d42b227@6c48a",
"atlasUuid": "", "atlasUuid": "",
"trimType": "auto" "trimType": "none"
}, },
"ver": "1.0.12", "ver": "1.0.12",
"imported": true, "imported": true,

View File

@@ -41,12 +41,12 @@
"userData": { "userData": {
"trimThreshold": 1, "trimThreshold": 1,
"rotated": false, "rotated": false,
"offsetX": 20.5, "offsetX": 0,
"offsetY": 27.5, "offsetY": 0,
"trimX": 41, "trimX": 0,
"trimY": 155, "trimY": 0,
"width": 679, "width": 720,
"height": 915, "height": 1280,
"rawWidth": 720, "rawWidth": 720,
"rawHeight": 1280, "rawHeight": 1280,
"borderTop": 0, "borderTop": 0,
@@ -60,17 +60,17 @@
"meshType": 0, "meshType": 0,
"vertices": { "vertices": {
"rawPosition": [ "rawPosition": [
-339.5, -360,
-457.5, -640,
0, 0,
339.5, 360,
-457.5, -640,
0, 0,
-339.5, -360,
457.5, 640,
0, 0,
339.5, 360,
457.5, 640,
0 0
], ],
"indexes": [ "indexes": [
@@ -82,40 +82,40 @@
3 3
], ],
"uv": [ "uv": [
41, 0,
1125, 1280,
720, 720,
1125, 1280,
41, 0,
210, 0,
720, 720,
210 0
], ],
"nuv": [ "nuv": [
0.05694444444444444, 0,
0.1640625, 0,
1, 1,
0.1640625, 0,
0.05694444444444444, 0,
0.87890625,
1, 1,
0.87890625 1,
1
], ],
"minPos": [ "minPos": [
-339.5, -360,
-457.5, -640,
0 0
], ],
"maxPos": [ "maxPos": [
339.5, 360,
457.5, 640,
0 0
] ]
}, },
"isUuid": true, "isUuid": true,
"imageUuidOrDatabaseUri": "67702aaf-c444-4d4c-8605-026cdbe6fee5@6c48a", "imageUuidOrDatabaseUri": "67702aaf-c444-4d4c-8605-026cdbe6fee5@6c48a",
"atlasUuid": "", "atlasUuid": "",
"trimType": "auto" "trimType": "none"
}, },
"ver": "1.0.12", "ver": "1.0.12",
"imported": true, "imported": true,

View File

@@ -41,12 +41,12 @@
"userData": { "userData": {
"trimThreshold": 1, "trimThreshold": 1,
"rotated": false, "rotated": false,
"offsetX": 20.5, "offsetX": 0,
"offsetY": 27.5, "offsetY": 0,
"trimX": 41, "trimX": 0,
"trimY": 155, "trimY": 0,
"width": 679, "width": 720,
"height": 915, "height": 1280,
"rawWidth": 720, "rawWidth": 720,
"rawHeight": 1280, "rawHeight": 1280,
"borderTop": 0, "borderTop": 0,
@@ -60,17 +60,17 @@
"meshType": 0, "meshType": 0,
"vertices": { "vertices": {
"rawPosition": [ "rawPosition": [
-339.5, -360,
-457.5, -640,
0, 0,
339.5, 360,
-457.5, -640,
0, 0,
-339.5, -360,
457.5, 640,
0, 0,
339.5, 360,
457.5, 640,
0 0
], ],
"indexes": [ "indexes": [
@@ -82,40 +82,40 @@
3 3
], ],
"uv": [ "uv": [
41, 0,
1125, 1280,
720, 720,
1125, 1280,
41, 0,
210, 0,
720, 720,
210 0
], ],
"nuv": [ "nuv": [
0.05694444444444444, 0,
0.1640625, 0,
1, 1,
0.1640625, 0,
0.05694444444444444, 0,
0.87890625,
1, 1,
0.87890625 1,
1
], ],
"minPos": [ "minPos": [
-339.5, -360,
-457.5, -640,
0 0
], ],
"maxPos": [ "maxPos": [
339.5, 360,
457.5, 640,
0 0
] ]
}, },
"isUuid": true, "isUuid": true,
"imageUuidOrDatabaseUri": "05946790-3cbd-42a1-a3b9-523d0e99ea3a@6c48a", "imageUuidOrDatabaseUri": "05946790-3cbd-42a1-a3b9-523d0e99ea3a@6c48a",
"atlasUuid": "", "atlasUuid": "",
"trimType": "auto" "trimType": "none"
}, },
"ver": "1.0.12", "ver": "1.0.12",
"imported": true, "imported": true,

File diff suppressed because it is too large Load Diff

View File

@@ -242,6 +242,13 @@ export class PlayerController extends Component {
// 开始沿路径移动 // 开始沿路径移动
this.currentPathIndex = 0; this.currentPathIndex = 0;
this.isMoving = true; this.isMoving = true;
// 根据移动方向选择动画
const animationName = this.getAnimationNameByDirection(startPos, clampedPos);
// 切换到对应的动画
this.switchAnimation(animationName);
this.moveToNextWaypoint(); this.moveToNextWaypoint();
} }
@@ -355,11 +362,6 @@ export class PlayerController extends Component {
const targetPos = this.currentPath[this.currentPathIndex]; const targetPos = this.currentPath[this.currentPathIndex];
const currentPos = this.player.position; const currentPos = this.player.position;
// 根据移动方向选择动画
const animationName = this.getAnimationNameByDirection(currentPos, targetPos);
// 切换到对应的动画
this.switchAnimation(animationName);
// 计算移动距离和时间 // 计算移动距离和时间
const distance = Vec3.distance(currentPos, targetPos); const distance = Vec3.distance(currentPos, targetPos);