parent
24c424810a
commit
efc1416b2f
@ -1,69 +1,48 @@ |
||||
|
||||
匹配中.png |
||||
size: 1519,602 |
||||
size: 1104,1104 |
||||
format: RGBA8888 |
||||
filter: Linear,Linear |
||||
repeat: none |
||||
中 |
||||
rotate: true |
||||
xy: 1381, 300 |
||||
size: 63, 78 |
||||
orig: 65, 80 |
||||
offset: 1, 1 |
||||
index: -1 |
||||
匹 |
||||
12a |
||||
rotate: false |
||||
xy: 1104, 266 |
||||
size: 68, 57 |
||||
orig: 70, 59 |
||||
offset: 1, 1 |
||||
xy: 0, 384 |
||||
size: 380, 380 |
||||
orig: 393, 392 |
||||
offset: 8, 4 |
||||
index: -1 |
||||
圆点 |
||||
VS |
||||
rotate: false |
||||
xy: 1104, 325 |
||||
size: 275, 277 |
||||
orig: 285, 290 |
||||
offset: 6, 8 |
||||
xy: 0, 156 |
||||
size: 252, 226 |
||||
orig: 252, 226 |
||||
offset: 0, 0 |
||||
index: -1 |
||||
对称光 |
||||
rotate: false |
||||
xy: 0, 266 |
||||
xy: 0, 766 |
||||
size: 1102, 336 |
||||
orig: 1102, 345 |
||||
offset: 0, 5 |
||||
index: -1 |
||||
战 |
||||
rotate: true |
||||
xy: 1376, 146 |
||||
size: 152, 143 |
||||
orig: 154, 145 |
||||
offset: 1, 1 |
||||
index: -1 |
||||
速度线 |
||||
rotate: true |
||||
xy: 1381, 435 |
||||
size: 167, 94 |
||||
orig: 183, 108 |
||||
offset: 9, 4 |
||||
index: -1 |
||||
配 |
||||
红方 |
||||
rotate: false |
||||
xy: 1381, 365 |
||||
size: 78, 68 |
||||
orig: 80, 70 |
||||
offset: 1, 1 |
||||
xy: 382, 468 |
||||
size: 474, 147 |
||||
orig: 474, 147 |
||||
offset: 0, 0 |
||||
index: -1 |
||||
飘带1 |
||||
蓝色 |
||||
rotate: false |
||||
xy: 0, 0 |
||||
size: 686, 264 |
||||
orig: 686, 264 |
||||
xy: 382, 617 |
||||
size: 474, 147 |
||||
orig: 474, 147 |
||||
offset: 0, 0 |
||||
index: -1 |
||||
飘带2 |
||||
速度线 |
||||
rotate: false |
||||
xy: 688, 0 |
||||
size: 686, 264 |
||||
orig: 686, 264 |
||||
offset: 0, 0 |
||||
xy: 858, 670 |
||||
size: 167, 94 |
||||
orig: 183, 108 |
||||
offset: 9, 4 |
||||
index: -1 |
||||
|
||||
File diff suppressed because one or more lines are too long
|
Before Width: | Height: | Size: 348 KiB After Width: | Height: | Size: 165 KiB |
@ -0,0 +1,9 @@ |
||||
{ |
||||
"ver": "1.2.0", |
||||
"importer": "directory", |
||||
"imported": true, |
||||
"uuid": "5031b965-b75f-43f3-b853-5a96fdaa5d0d", |
||||
"files": [], |
||||
"subMetas": {}, |
||||
"userData": {} |
||||
} |
||||
@ -0,0 +1 @@ |
||||
D:\WXWork\1688855084654441\WeDrive\中昱智云\抖音游戏\战斗类\【新】2048数字守卫战\动效\宝箱打开 |
||||
@ -0,0 +1,9 @@ |
||||
{ |
||||
"ver": "1.2.0", |
||||
"importer": "directory", |
||||
"imported": true, |
||||
"uuid": "0e2ea3ab-53f3-4d87-832b-91c723ceee29", |
||||
"files": [], |
||||
"subMetas": {}, |
||||
"userData": {} |
||||
} |
||||
@ -0,0 +1 @@ |
||||
D:\WXWork\1688855084654441\WeDrive\中昱智云\抖音游戏\战斗类\【新】2048数字守卫战\动效\宝箱打开\宝箱打开JSON |
||||
@ -0,0 +1,76 @@ |
||||
|
||||
xiangzi2.png |
||||
size: 272,272 |
||||
format: RGBA8888 |
||||
filter: Linear,Linear |
||||
repeat: none |
||||
h_1 |
||||
rotate: false |
||||
xy: 82, 31 |
||||
size: 20, 22 |
||||
orig: 20, 22 |
||||
offset: 0, 0 |
||||
index: -1 |
||||
h_10 |
||||
rotate: false |
||||
xy: 0, 168 |
||||
size: 104, 104 |
||||
orig: 120, 114 |
||||
offset: 8, 2 |
||||
index: -1 |
||||
h_2 |
||||
rotate: false |
||||
xy: 12, 3 |
||||
size: 7, 7 |
||||
orig: 10, 10 |
||||
offset: 1, 2 |
||||
index: -1 |
||||
h_3 |
||||
rotate: false |
||||
xy: 12, 3 |
||||
size: 7, 7 |
||||
orig: 10, 10 |
||||
offset: 1, 2 |
||||
index: -1 |
||||
h_4 |
||||
rotate: false |
||||
xy: 12, 3 |
||||
size: 7, 7 |
||||
orig: 10, 10 |
||||
offset: 1, 2 |
||||
index: -1 |
||||
h_5 |
||||
rotate: false |
||||
xy: 0, 0 |
||||
size: 10, 10 |
||||
orig: 13, 13 |
||||
offset: 1, 2 |
||||
index: -1 |
||||
h_6 |
||||
rotate: false |
||||
xy: 0, 0 |
||||
size: 10, 10 |
||||
orig: 13, 13 |
||||
offset: 1, 2 |
||||
index: -1 |
||||
h_8 |
||||
rotate: false |
||||
xy: 0, 79 |
||||
size: 82, 87 |
||||
orig: 82, 87 |
||||
offset: 0, 0 |
||||
index: -1 |
||||
h_9 |
||||
rotate: false |
||||
xy: 0, 12 |
||||
size: 80, 65 |
||||
orig: 86, 71 |
||||
offset: 3, 3 |
||||
index: -1 |
||||
l_77 |
||||
rotate: true |
||||
xy: 82, 55 |
||||
size: 22, 21 |
||||
orig: 23, 23 |
||||
offset: 1, 1 |
||||
index: -1 |
||||
@ -0,0 +1,12 @@ |
||||
{ |
||||
"ver": "1.0.0", |
||||
"importer": "*", |
||||
"imported": true, |
||||
"uuid": "0af7ee96-c5d5-4b00-916b-3f4a773b9067", |
||||
"files": [ |
||||
".atlas", |
||||
".json" |
||||
], |
||||
"subMetas": {}, |
||||
"userData": {} |
||||
} |
||||
File diff suppressed because one or more lines are too long
@ -0,0 +1,13 @@ |
||||
{ |
||||
"ver": "1.2.7", |
||||
"importer": "spine-data", |
||||
"imported": true, |
||||
"uuid": "7b662a97-3ca9-42ab-b43b-8977019688f5", |
||||
"files": [ |
||||
".json" |
||||
], |
||||
"subMetas": {}, |
||||
"userData": { |
||||
"atlasUuid": "0af7ee96-c5d5-4b00-916b-3f4a773b9067" |
||||
} |
||||
} |
||||
|
After Width: | Height: | Size: 44 KiB |
@ -0,0 +1,134 @@ |
||||
{ |
||||
"ver": "1.0.27", |
||||
"importer": "image", |
||||
"imported": true, |
||||
"uuid": "6bd5b27b-f93f-4fd0-88c8-226764410577", |
||||
"files": [ |
||||
".json", |
||||
".png" |
||||
], |
||||
"subMetas": { |
||||
"6c48a": { |
||||
"importer": "texture", |
||||
"uuid": "6bd5b27b-f93f-4fd0-88c8-226764410577@6c48a", |
||||
"displayName": "xiangzi2", |
||||
"id": "6c48a", |
||||
"name": "texture", |
||||
"userData": { |
||||
"wrapModeS": "clamp-to-edge", |
||||
"wrapModeT": "clamp-to-edge", |
||||
"imageUuidOrDatabaseUri": "6bd5b27b-f93f-4fd0-88c8-226764410577", |
||||
"isUuid": true, |
||||
"visible": false, |
||||
"minfilter": "linear", |
||||
"magfilter": "linear", |
||||
"mipfilter": "none", |
||||
"anisotropy": 0 |
||||
}, |
||||
"ver": "1.0.22", |
||||
"imported": true, |
||||
"files": [ |
||||
".json" |
||||
], |
||||
"subMetas": {} |
||||
}, |
||||
"f9941": { |
||||
"importer": "sprite-frame", |
||||
"uuid": "6bd5b27b-f93f-4fd0-88c8-226764410577@f9941", |
||||
"displayName": "xiangzi2", |
||||
"id": "f9941", |
||||
"name": "spriteFrame", |
||||
"userData": { |
||||
"trimThreshold": 1, |
||||
"rotated": false, |
||||
"offsetX": -84, |
||||
"offsetY": 0, |
||||
"trimX": 0, |
||||
"trimY": 0, |
||||
"width": 104, |
||||
"height": 272, |
||||
"rawWidth": 272, |
||||
"rawHeight": 272, |
||||
"borderTop": 0, |
||||
"borderBottom": 0, |
||||
"borderLeft": 0, |
||||
"borderRight": 0, |
||||
"packable": true, |
||||
"pixelsToUnit": 100, |
||||
"pivotX": 0.5, |
||||
"pivotY": 0.5, |
||||
"meshType": 0, |
||||
"vertices": { |
||||
"rawPosition": [ |
||||
-52, |
||||
-136, |
||||
0, |
||||
52, |
||||
-136, |
||||
0, |
||||
-52, |
||||
136, |
||||
0, |
||||
52, |
||||
136, |
||||
0 |
||||
], |
||||
"indexes": [ |
||||
0, |
||||
1, |
||||
2, |
||||
2, |
||||
1, |
||||
3 |
||||
], |
||||
"uv": [ |
||||
0, |
||||
272, |
||||
104, |
||||
272, |
||||
0, |
||||
0, |
||||
104, |
||||
0 |
||||
], |
||||
"nuv": [ |
||||
0, |
||||
0, |
||||
0.38235294117647056, |
||||
0, |
||||
0, |
||||
1, |
||||
0.38235294117647056, |
||||
1 |
||||
], |
||||
"minPos": [ |
||||
-52, |
||||
-136, |
||||
0 |
||||
], |
||||
"maxPos": [ |
||||
52, |
||||
136, |
||||
0 |
||||
] |
||||
}, |
||||
"isUuid": true, |
||||
"imageUuidOrDatabaseUri": "6bd5b27b-f93f-4fd0-88c8-226764410577@6c48a", |
||||
"atlasUuid": "", |
||||
"trimType": "auto" |
||||
}, |
||||
"ver": "1.0.12", |
||||
"imported": true, |
||||
"files": [ |
||||
".json" |
||||
], |
||||
"subMetas": {} |
||||
} |
||||
}, |
||||
"userData": { |
||||
"type": "sprite-frame", |
||||
"fixAlphaTransparencyArtifacts": false, |
||||
"hasAlpha": true, |
||||
"redirect": "6bd5b27b-f93f-4fd0-88c8-226764410577@6c48a" |
||||
} |
||||
} |
||||
@ -1 +1 @@ |
||||
D:\WXWork\1688855084654441\WeDrive\中昱智云\抖音游戏\战斗类\【新】西游文字塔防\动效\正在加载 |
||||
D:\WXWork\1688855084654441\WeDrive\中昱智云\抖音游戏\战斗类\【新】2048数字守卫战\动效\正在加载 |
||||
@ -1,48 +1,41 @@ |
||||
|
||||
正在加载.png |
||||
size: 389,155 |
||||
size: 284,284 |
||||
format: RGBA8888 |
||||
filter: Linear,Linear |
||||
repeat: none |
||||
云层1 |
||||
大星球 |
||||
rotate: false |
||||
xy: 290, 0 |
||||
size: 69, 37 |
||||
orig: 71, 39 |
||||
offset: 1, 1 |
||||
index: -1 |
||||
云层2 |
||||
rotate: true |
||||
xy: 341, 101 |
||||
size: 54, 30 |
||||
orig: 56, 32 |
||||
offset: 1, 1 |
||||
xy: 0, 112 |
||||
size: 172, 172 |
||||
orig: 176, 176 |
||||
offset: 2, 2 |
||||
index: -1 |
||||
云层3 |
||||
rotate: true |
||||
xy: 361, 23 |
||||
size: 76, 28 |
||||
orig: 78, 30 |
||||
撞色标题 |
||||
rotate: false |
||||
xy: 0, 31 |
||||
size: 220, 79 |
||||
orig: 222, 81 |
||||
offset: 1, 1 |
||||
index: -1 |
||||
云层4 |
||||
rotate: true |
||||
xy: 290, 39 |
||||
size: 116, 49 |
||||
orig: 118, 51 |
||||
offset: 1, 1 |
||||
星球 |
||||
rotate: false |
||||
xy: 174, 227 |
||||
size: 57, 57 |
||||
orig: 61, 61 |
||||
offset: 2, 2 |
||||
index: -1 |
||||
正在加载 |
||||
轨迹1 |
||||
rotate: false |
||||
xy: 0, 1 |
||||
size: 288, 154 |
||||
orig: 290, 156 |
||||
xy: 0, 0 |
||||
size: 229, 29 |
||||
orig: 231, 31 |
||||
offset: 1, 1 |
||||
index: -1 |
||||
点 |
||||
rotate: false |
||||
xy: 361, 3 |
||||
size: 18, 18 |
||||
orig: 20, 20 |
||||
轨迹2 |
||||
rotate: true |
||||
xy: 233, 55 |
||||
size: 229, 26 |
||||
orig: 231, 28 |
||||
offset: 1, 1 |
||||
index: -1 |
||||
|
||||
@ -1 +1 @@ |
||||
{"skeleton":{"hash":"sBHrWRenlj+WCimdNiB1EH2cJ3g","spine":"3.8.75","x":-155,"y":-67,"width":317,"height":176,"images":"./images/","audio":"E:/工作文件/1项目汇总/5战斗游戏/V4/动效/加载动画"},"bones":[{"name":"root"},{"name":"bone","parent":"root","length":30.47,"rotation":-91.59,"x":1.17,"y":-5.21},{"name":"点","parent":"bone","x":45.77,"y":73.63},{"name":"云层4","parent":"bone","length":25.83,"rotation":-85.59,"x":-44.17,"y":-100.67},{"name":"云层2","parent":"bone","length":21.17,"rotation":89.3,"x":-98.76,"y":-39.98},{"name":"云层3","parent":"bone","length":25.38,"rotation":91.59,"x":-78.89,"y":67.63},{"name":"云层1","parent":"bone","length":22,"rotation":92.69,"x":-48.73,"y":124.33},{"name":"点2","parent":"bone","x":44.94,"y":103.72},{"name":"点3","parent":"bone","x":44.08,"y":134.72}],"slots":[{"name":"云层4","bone":"云层4","attachment":"云层4"},{"name":"云层3","bone":"云层3","attachment":"云层3"},{"name":"云层2","bone":"云层2","attachment":"云层2"},{"name":"云层1","bone":"云层1","attachment":"云层1"},{"name":"正在加载","bone":"root","attachment":"正在加载"},{"name":"点","bone":"点","attachment":"点"},{"name":"点2","bone":"点2","attachment":"点"},{"name":"点3","bone":"点3","attachment":"点"}],"skins":[{"name":"default","attachments":{"云层1":{"云层1":{"x":-0.32,"y":-0.55,"rotation":-1.1,"width":71,"height":39}},"云层2":{"云层2":{"x":0.11,"y":-1.62,"rotation":2.29,"width":56,"height":32}},"云层3":{"云层3":{"x":-5.97,"y":1.22,"width":78,"height":30}},"云层4":{"云层4":{"x":-4.21,"y":0.45,"rotation":177.18,"width":118,"height":51}},"正在加载":{"正在加载":{"x":-10,"y":11,"width":290,"height":156}},"点2":{"点":{"x":-0.99,"y":-0.53,"rotation":91.59,"width":20,"height":20}},"点3":{"点":{"x":-0.99,"y":-0.53,"rotation":91.59,"width":20,"height":20}},"点":{"点":{"x":-0.99,"y":-0.53,"rotation":91.59,"width":20,"height":20}}}}],"animations":{"正在加载":{"slots":{"点2":{"color":[{"color":"ffffff00","curve":"stepped"},{"time":0.5,"color":"ffffff00"},{"time":0.6667,"color":"ffffffff","curve":"stepped"},{"time":1.1667,"color":"ffffffff"},{"time":1.5,"color":"ffffff00"}]},"点":{"color":[{"color":"ffffff00"},{"time":0.1667,"color":"ffffffff","curve":"stepped"},{"time":0.6667,"color":"ffffffff"},{"time":1,"color":"ffffff00"}]},"点3":{"color":[{"color":"ffffff00","curve":"stepped"},{"time":1,"color":"ffffff00"},{"time":1.1667,"color":"ffffffff","curve":"stepped"},{"time":1.6667,"color":"ffffffff"},{"time":2,"color":"ffffff00"}]}},"bones":{"云层4":{"translate":[{"curve":0.25,"c3":0.75},{"time":1,"x":0.55,"y":-19.9,"curve":0.25,"c3":0.75},{"time":2}]},"云层2":{"translate":[{"x":-1.75,"y":-3.33,"curve":0.382,"c2":0.57,"c3":0.735},{"time":0.3333},{"time":1.3333,"x":-6.16,"y":-11.75,"curve":0.243,"c3":0.649,"c4":0.6},{"time":2,"x":-1.75,"y":-3.33}]},"云层3":{"translate":[{"x":-12.39,"y":9.28,"curve":0.311,"c2":0.25,"c3":0.757},{"time":0.8333},{"time":1.8333,"x":-13.72,"y":10.27,"curve":0.29,"c3":0.629,"c4":0.38},{"time":2,"x":-12.39,"y":9.28}]},"云层1":{"translate":[{"x":-0.31,"y":11.34,"curve":0.375,"c2":0.5,"c3":0.75},{"time":0.5,"x":-0.63,"y":22.68,"curve":0.25,"c3":0.75},{"time":1.5,"curve":0.25,"c3":0.625,"c4":0.5},{"time":2,"x":-0.31,"y":11.34}]}}}}} |
||||
{"skeleton":{"hash":"NTrQs4MH8Fam8f0OG/6ALJZTnFE","spine":"3.8.75","x":-144.67,"y":-119.49,"width":258.67,"height":239.49},"bones":[{"name":"root"},{"name":"轨迹2","parent":"root","length":34.04,"x":-1.69,"y":20.97},{"name":"星球","parent":"轨迹2","x":-109.52,"y":4.44},{"name":"撞色标题","parent":"root","length":41.76,"rotation":-91.24,"x":-2.99,"y":-81.92}],"slots":[{"name":"撞色标题","bone":"撞色标题","attachment":"撞色标题"},{"name":"轨迹2","bone":"轨迹2","attachment":"轨迹2"},{"name":"大星球","bone":"root","attachment":"大星球"},{"name":"轨迹1","bone":"轨迹2","attachment":"轨迹1"},{"name":"root33","bone":"root","attachment":"root33"},{"name":"星球","bone":"星球","attachment":"星球"},{"name":"星球2","bone":"星球","attachment":"星球"},{"name":"轨迹22","bone":"轨迹2","attachment":"轨迹22"}],"path":[{"name":"轨迹22","bones":["星球"],"target":"轨迹22","rotateMix":0}],"skins":[{"name":"default","attachments":{"轨迹1":{"轨迹1":{"x":0.19,"y":-9.47,"width":231,"height":31}},"轨迹2":{"轨迹2":{"x":0.19,"y":18.03,"width":231,"height":28}},"root33":{"root33":{"type":"clipping","end":"星球","vertexCount":27,"vertices":[-62.88,4.79,-69.14,24.24,-68.05,45.86,-60.57,65.18,-48.74,80.54,-34.19,91.42,-15.01,97.68,2.67,99.18,22.33,95.7,39.39,85.59,53.61,100.66,61.53,170.28,-146.98,167.98,-180.99,-68.07,166.46,-65.38,139.74,154.36,54.05,100.31,39.9,85.13,57.6,66.24,65.82,41.3,64.97,17.34,53.86,-7.46,34.69,-25.49,14.1,-33.73,-10.18,-35.15,-32.47,-29.04,-52.92,-12.71]}},"星球":{"星球":{"x":-0.29,"y":0.09,"width":61,"height":61}},"撞色标题":{"撞色标题":{"x":-4.46,"y":3.95,"rotation":90.49,"width":222,"height":81}},"轨迹22":{"轨迹22":{"type":"path","closed":true,"lengths":[117.47,238.92,355,456.31],"vertexCount":12,"vertices":[-102.14,22.89,-112.19,4.56,-117.05,-4.31,-74.97,-22.7,-1.78,-22.17,70.44,-21.65,115.9,-8.92,111,5.78,106.1,20.48,41.42,27.59,-0.96,27.59,-43.34,27.59]}},"大星球":{"大星球":{"x":-2,"y":32,"width":176,"height":176}},"星球2":{"星球":{"x":-0.29,"y":0.09,"width":61,"height":61}}}}],"animations":{"animation":{"bones":{"轨迹2":{"rotate":[{"curve":0.25,"c3":0.75},{"time":1.5,"angle":-16.47,"curve":0.25,"c3":0.75},{"time":3}]},"撞色标题":{"scale":[{"curve":0.25,"c3":0.75},{"time":0.7667,"x":1.033,"y":1.033,"curve":0.25,"c3":0.75},{"time":1.5,"curve":0.25,"c3":0.75},{"time":2.2667,"x":1.033,"y":1.033,"curve":0.25,"c3":0.75},{"time":3}]}},"path":{"轨迹22":{"position":[{"curve":0.25,"c3":0.75},{"time":1.5,"position":0.5,"curve":0.25,"c3":0.75},{"time":3,"position":1}]}},"drawOrder":[{"time":1.8,"offsets":[{"slot":"星球2","offset":-6}]}]}}} |
||||
|
Before Width: | Height: | Size: 85 KiB After Width: | Height: | Size: 58 KiB |
@ -1,115 +0,0 @@ |
||||
import { isValid, Node, Tween, tween, UIOpacity, UITransform, Vec3 } from 'cc'; |
||||
import { GBundle } from '../../game/ConfigRes'; |
||||
|
||||
/** 宝箱预制路径 */ |
||||
const CHEST_TIP_PATH = 'prefab/'; |
||||
/** 宝箱预制名 */ |
||||
const CHEST_TIP_NAME = '宝箱'; |
||||
/** 飞入时长(秒) */ |
||||
const FLY_SEC = 0.55; |
||||
/** 终点缩放 */ |
||||
const FLY_END_SCALE = 10; |
||||
/** 复用世界坐标 */ |
||||
const _world = new Vec3(); |
||||
/** 复用本地坐标 */ |
||||
const _local = new Vec3(); |
||||
/** 飞向层本地中心 */ |
||||
const _endLocal = new Vec3(0, 0, 0); |
||||
|
||||
/** |
||||
* 开挖宝箱飞向屏幕中央放大渐隐。 |
||||
*/ |
||||
export class BattleDigChestFxPresenter { |
||||
private _layer: Node | null = null; |
||||
private _flying: Node | null = null; |
||||
private _gen = 0; |
||||
|
||||
/** |
||||
* @param layer 飞行层(ui_fly) |
||||
*/ |
||||
bind(layer: Node | null): void { |
||||
this.clear(); |
||||
this._layer = layer; |
||||
} |
||||
|
||||
/** 停止并回收进行中的飞入 */ |
||||
clear(): void { |
||||
this._gen++; |
||||
this._recycleFlying(); |
||||
this._layer = null; |
||||
} |
||||
|
||||
/** |
||||
* 宝箱从起点飞向屏中,放大到 10 倍并渐隐,结束后回调。 |
||||
* @param worldPos 起点世界坐标 |
||||
* @param onDone 结束回调 |
||||
*/ |
||||
playFly(worldPos: Vec3 | null, onDone: () => void): void { |
||||
this._recycleFlying(); |
||||
const layer = this._layer; |
||||
if (!layer?.isValid || !worldPos) { |
||||
console.warn('[BattleDigChestFx] 飞入层或起点无效,跳过飞入'); |
||||
onDone(); |
||||
return; |
||||
} |
||||
if (typeof gg === 'undefined' || !gg.res?.getNode) { |
||||
console.warn('[BattleDigChestFx] gg.res 未就绪,跳过飞入'); |
||||
onDone(); |
||||
return; |
||||
} |
||||
const tip = gg.res.getNode(CHEST_TIP_PATH, CHEST_TIP_NAME, GBundle.BattleGame); |
||||
if (!tip?.isValid) { |
||||
console.warn('[BattleDigChestFx] 缺少宝箱,跳过飞入'); |
||||
onDone(); |
||||
return; |
||||
} |
||||
const fly = tip; |
||||
fly.parent = layer; |
||||
fly.setSiblingIndex(layer.children.length - 1); |
||||
fly.active = true; |
||||
fly.setScale(1, 1, 1); |
||||
let opacity = fly.getComponent(UIOpacity); |
||||
if (!opacity) opacity = fly.addComponent(UIOpacity); |
||||
opacity.opacity = 255; |
||||
_world.set(worldPos.x, worldPos.y, worldPos.z); |
||||
const ut = layer.getComponent(UITransform); |
||||
if (ut) { |
||||
ut.convertToNodeSpaceAR(_world, _local); |
||||
fly.setPosition(_local); |
||||
} else { |
||||
fly.setWorldPosition(_world); |
||||
} |
||||
this._flying = fly; |
||||
const gen = ++this._gen; |
||||
// ui_fly 居中锚点时本地 (0,0) 即屏中
|
||||
const endPos = _endLocal.clone(); |
||||
Tween.stopAllByTarget(fly); |
||||
tween(fly) |
||||
.to(FLY_SEC, { position: endPos, scale: new Vec3(FLY_END_SCALE, FLY_END_SCALE, 1) }, { easing: 'sineOut' }) |
||||
.start(); |
||||
tween(opacity) |
||||
.to(FLY_SEC, { opacity: 0 }, { easing: 'sineIn' }) |
||||
.call(() => { |
||||
if (gen !== this._gen) return; |
||||
this._recycleFlying(); |
||||
onDone(); |
||||
}) |
||||
.start(); |
||||
} |
||||
|
||||
private _recycleFlying(): void { |
||||
const fly = this._flying; |
||||
this._flying = null; |
||||
if (!fly || !isValid(fly)) return; |
||||
Tween.stopAllByTarget(fly); |
||||
const op = fly.getComponent(UIOpacity); |
||||
if (op) Tween.stopAllByTarget(op); |
||||
fly.setScale(1, 1, 1); |
||||
if (op) op.opacity = 255; |
||||
if (fly['resKey'] && typeof gg !== 'undefined' && gg.res?.putNode) { |
||||
gg.res.putNode(fly); |
||||
} else { |
||||
fly.destroy(); |
||||
} |
||||
} |
||||
} |
||||
@ -1,9 +0,0 @@ |
||||
{ |
||||
"ver": "4.0.24", |
||||
"importer": "typescript", |
||||
"imported": true, |
||||
"uuid": "4ac2d221-78d6-4f04-923e-9eb7058d9e19", |
||||
"files": [], |
||||
"subMetas": {}, |
||||
"userData": {} |
||||
} |
||||
Loading…
Reference in new issue