diff --git a/assets/Game/prefabs/Icon/Icon0.prefab b/assets/Game/prefabs/Icon/Icon0.prefab index bb211b7..c9d75cc 100644 --- a/assets/Game/prefabs/Icon/Icon0.prefab +++ b/assets/Game/prefabs/Icon/Icon0.prefab @@ -88,7 +88,7 @@ "__id__": 15 } ], - "_active": true, + "_active": false, "_components": [ { "__id__": 21 @@ -503,7 +503,7 @@ "__expectedType__": "sp.SkeletonData" }, "defaultSkin": "default", - "defaultAnimation": "idle_1", + "defaultAnimation": "idle_4", "_premultipliedAlpha": false, "_timeScale": 1, "_preCacheMode": 0, @@ -639,7 +639,7 @@ "__id__": 33 } ], - "_active": false, + "_active": true, "_components": [ { "__id__": 39 diff --git a/assets/Game/prefabs/SlotScene.prefab b/assets/Game/prefabs/SlotScene.prefab index 8edac6f..ea7182d 100644 --- a/assets/Game/prefabs/SlotScene.prefab +++ b/assets/Game/prefabs/SlotScene.prefab @@ -1270,7 +1270,7 @@ "__id__": 48 }, "asset": { - "__uuid__": "79c428b2-5899-404c-8495-991b407ef71b", + "__uuid__": "e218006e-19e0-486f-b9db-e13d4c1f6cad", "__expectedType__": "cc.Prefab" }, "fileId": "fchELCmEtHhb3lT1fagDGR", @@ -1281,7 +1281,7 @@ }, { "__type__": "cc.PrefabInstance", - "fileId": "c2UGg88ppP4ovvFvbG4spS", + "fileId": "49dcTtERNCma+8MPy5aHt6", "prefabRootNode": { "__id__": 1 }, @@ -1307,7 +1307,7 @@ "__id__": 51 }, "asset": { - "__uuid__": "79c428b2-5899-404c-8495-991b407ef71b", + "__uuid__": "55a879b3-2ccd-48e3-bd43-c984e67f1637", "__expectedType__": "cc.Prefab" }, "fileId": "fchELCmEtHhb3lT1fagDGR", @@ -1318,7 +1318,7 @@ }, { "__type__": "cc.PrefabInstance", - "fileId": "49YC+in7ZJpIRVS9P8u/Nq", + "fileId": "61iie93hNHA4tl7lYO4/VN", "prefabRootNode": { "__id__": 1 }, @@ -1344,7 +1344,7 @@ "__id__": 54 }, "asset": { - "__uuid__": "55a879b3-2ccd-48e3-bd43-c984e67f1637", + "__uuid__": "a185ad99-a791-4309-9851-549c756647b9", "__expectedType__": "cc.Prefab" }, "fileId": "fchELCmEtHhb3lT1fagDGR", @@ -1355,7 +1355,7 @@ }, { "__type__": "cc.PrefabInstance", - "fileId": "00AgrcLuJFBr9ajUa8j4ZP", + "fileId": "89o2oHaXtFx4h/p/ta1sb6", "prefabRootNode": { "__id__": 1 }, @@ -1381,7 +1381,7 @@ "__id__": 57 }, "asset": { - "__uuid__": "f8999765-2b3b-4d22-8a12-dd5165927db7", + "__uuid__": "55a879b3-2ccd-48e3-bd43-c984e67f1637", "__expectedType__": "cc.Prefab" }, "fileId": "fchELCmEtHhb3lT1fagDGR", @@ -1392,7 +1392,7 @@ }, { "__type__": "cc.PrefabInstance", - "fileId": "faWLdKjCNPRo0F8+eVWMA2", + "fileId": "10Gez3QqhAiLBUMHzcJg2/", "prefabRootNode": { "__id__": 1 }, @@ -1418,7 +1418,7 @@ "__id__": 60 }, "asset": { - "__uuid__": "31e7557b-3a6b-4d2d-9daf-5a5e4b522638", + "__uuid__": "e218006e-19e0-486f-b9db-e13d4c1f6cad", "__expectedType__": "cc.Prefab" }, "fileId": "fchELCmEtHhb3lT1fagDGR", @@ -1429,7 +1429,7 @@ }, { "__type__": "cc.PrefabInstance", - "fileId": "3cACdo5WBM0Y54kegG6Dxo", + "fileId": "a79rqWOjZP+ahKH5wQ4d7b", "prefabRootNode": { "__id__": 1 }, @@ -1464,7 +1464,7 @@ }, { "__type__": "cc.CompPrefabInfo", - "fileId": "0cQxezrf9Ma5AUL6sML/Yu" + "fileId": "4e+f5dqHpIG7ZwKAMXI1Uh" }, { "__type__": "cc.PrefabInfo", @@ -1474,7 +1474,7 @@ "asset": { "__id__": 0 }, - "fileId": "cfpzGkC25A4JhrkqDf4q25", + "fileId": "27HMo53LZBq7M7uj925mcA", "instance": null, "targetOverrides": null, "nestedPrefabInstanceRoots": null @@ -1505,7 +1505,7 @@ }, { "__type__": "cc.CompPrefabInfo", - "fileId": "47LGISve1OAIcPoIc7hQfx" + "fileId": "1fag1JhMxLpZzLvepj3Qox" }, { "__type__": "cc.PrefabInfo", @@ -1515,7 +1515,7 @@ "asset": { "__id__": 0 }, - "fileId": "8aoHo/+FlBg6GmNBGTMWiz", + "fileId": "54gKJC749FTJS/MmB7j41v", "instance": null, "targetOverrides": null, "nestedPrefabInstanceRoots": null @@ -1546,7 +1546,7 @@ }, { "__type__": "cc.CompPrefabInfo", - "fileId": "5ckOPbBuxCu7INjDN9i5ri" + "fileId": "a2l1jb6gtK7awnU2PdY1tU" }, { "__type__": "45522uB1sdFu4FJAojtnha4", @@ -1571,7 +1571,7 @@ }, { "__type__": "cc.CompPrefabInfo", - "fileId": "7bUJbQV7FOr5Q5lYrAiGla" + "fileId": "c2FoztheNKLIHkLnQv0hNm" }, { "__type__": "5fd13+Xa69CZogb3Q/F1lnC", @@ -1744,7 +1744,7 @@ "asset": { "__id__": 0 }, - "fileId": "b76NcuGVVKI4jRhRO1fkHj", + "fileId": "6fZmQYXcJHxJO7hvQcq3vC", "instance": null, "targetOverrides": null, "nestedPrefabInstanceRoots": null @@ -1934,7 +1934,7 @@ "__id__": 83 }, "asset": { - "__uuid__": "2c62af7c-9b93-48ff-bd76-a2dfd799659e", + "__uuid__": "f8999765-2b3b-4d22-8a12-dd5165927db7", "__expectedType__": "cc.Prefab" }, "fileId": "fchELCmEtHhb3lT1fagDGR", @@ -1945,7 +1945,7 @@ }, { "__type__": "cc.PrefabInstance", - "fileId": "14sAa4EppJyKgdRqGYzad2", + "fileId": "f3u964KjRKgK8g/dyIQ/g+", "prefabRootNode": { "__id__": 1 }, @@ -1971,7 +1971,7 @@ "__id__": 86 }, "asset": { - "__uuid__": "a185ad99-a791-4309-9851-549c756647b9", + "__uuid__": "e218006e-19e0-486f-b9db-e13d4c1f6cad", "__expectedType__": "cc.Prefab" }, "fileId": "fchELCmEtHhb3lT1fagDGR", @@ -1982,7 +1982,7 @@ }, { "__type__": "cc.PrefabInstance", - "fileId": "06M12VpEJABLXUSQh8LH8i", + "fileId": "50K8P0pZtJMLPtE4/dDnlW", "prefabRootNode": { "__id__": 1 }, @@ -2008,7 +2008,7 @@ "__id__": 89 }, "asset": { - "__uuid__": "79c428b2-5899-404c-8495-991b407ef71b", + "__uuid__": "c2de34b1-99b2-49c4-a6ec-44eeb63b12cd", "__expectedType__": "cc.Prefab" }, "fileId": "fchELCmEtHhb3lT1fagDGR", @@ -2019,7 +2019,7 @@ }, { "__type__": "cc.PrefabInstance", - "fileId": "d1yP2KvehPjZZ958xtzmhL", + "fileId": "04hNx4OKNLHq7SWd5orxLd", "prefabRootNode": { "__id__": 1 }, @@ -2045,7 +2045,7 @@ "__id__": 92 }, "asset": { - "__uuid__": "2c62af7c-9b93-48ff-bd76-a2dfd799659e", + "__uuid__": "5347ef5a-5046-4c36-be8f-bb27dc475204", "__expectedType__": "cc.Prefab" }, "fileId": "fchELCmEtHhb3lT1fagDGR", @@ -2056,7 +2056,7 @@ }, { "__type__": "cc.PrefabInstance", - "fileId": "deUQufYsBI05aOdw7h5o6W", + "fileId": "59jomdxe5Dr7Jsf+RNR9kx", "prefabRootNode": { "__id__": 1 }, @@ -2082,7 +2082,7 @@ "__id__": 95 }, "asset": { - "__uuid__": "31e7557b-3a6b-4d2d-9daf-5a5e4b522638", + "__uuid__": "e218006e-19e0-486f-b9db-e13d4c1f6cad", "__expectedType__": "cc.Prefab" }, "fileId": "fchELCmEtHhb3lT1fagDGR", @@ -2093,7 +2093,7 @@ }, { "__type__": "cc.PrefabInstance", - "fileId": "db+KsgBmlH2ZSkt0GiIOee", + "fileId": "a3ybD7XhFJz6/u1ZBjijIo", "prefabRootNode": { "__id__": 1 }, @@ -2128,7 +2128,7 @@ }, { "__type__": "cc.CompPrefabInfo", - "fileId": "9c47t66xxLV6OcQ+3NuNve" + "fileId": "2537JjRfVCArCylIGNGc68" }, { "__type__": "cc.PrefabInfo", @@ -2138,7 +2138,7 @@ "asset": { "__id__": 0 }, - "fileId": "f7BY1ed09JM5MR6TdWxJu5", + "fileId": "f6X6niLQxLtK8EHTKm3sGG", "instance": null, "targetOverrides": null, "nestedPrefabInstanceRoots": null @@ -2169,7 +2169,7 @@ }, { "__type__": "cc.CompPrefabInfo", - "fileId": "8dQmHaHAVDFask1p83iqvB" + "fileId": "5bPtbv5DBLfphOoPjxgrh4" }, { "__type__": "cc.PrefabInfo", @@ -2179,7 +2179,7 @@ "asset": { "__id__": 0 }, - "fileId": "3emTtGZJtIa58gYv8Wp0Xq", + "fileId": "68LyEO8M1G2pjg4eOVwUlD", "instance": null, "targetOverrides": null, "nestedPrefabInstanceRoots": null @@ -2210,7 +2210,7 @@ }, { "__type__": "cc.CompPrefabInfo", - "fileId": "28B1FEIapFO50YUmDIgATq" + "fileId": "22hapk9bhHMaJBY4N3YNjr" }, { "__type__": "45522uB1sdFu4FJAojtnha4", @@ -2235,7 +2235,7 @@ }, { "__type__": "cc.CompPrefabInfo", - "fileId": "46C3776UtD6qmHHzT7hb/0" + "fileId": "c6AcUh5GdECbVCza/OD7bg" }, { "__type__": "cc.PrefabInfo", @@ -2245,7 +2245,7 @@ "asset": { "__id__": 0 }, - "fileId": "8aFUy5KOlL/53H4Y7huwJL", + "fileId": "1ewhCJDWhMgr/Kcl49RPzP", "instance": null, "targetOverrides": null, "nestedPrefabInstanceRoots": null @@ -2435,7 +2435,7 @@ "__id__": 112 }, "asset": { - "__uuid__": "2c62af7c-9b93-48ff-bd76-a2dfd799659e", + "__uuid__": "5347ef5a-5046-4c36-be8f-bb27dc475204", "__expectedType__": "cc.Prefab" }, "fileId": "fchELCmEtHhb3lT1fagDGR", @@ -2446,7 +2446,7 @@ }, { "__type__": "cc.PrefabInstance", - "fileId": "a0RD9G9CpFU63quiyKv9KV", + "fileId": "5dgEAu99VGtYqAbPC9Faol", "prefabRootNode": { "__id__": 1 }, @@ -2472,7 +2472,7 @@ "__id__": 115 }, "asset": { - "__uuid__": "55a879b3-2ccd-48e3-bd43-c984e67f1637", + "__uuid__": "2c62af7c-9b93-48ff-bd76-a2dfd799659e", "__expectedType__": "cc.Prefab" }, "fileId": "fchELCmEtHhb3lT1fagDGR", @@ -2483,7 +2483,7 @@ }, { "__type__": "cc.PrefabInstance", - "fileId": "e9x8ibQANF4YUm+3690LCG", + "fileId": "b1UvGu+ehGPaDB+d6kYEDw", "prefabRootNode": { "__id__": 1 }, @@ -2509,7 +2509,7 @@ "__id__": 118 }, "asset": { - "__uuid__": "a0fd2fb6-af52-4b80-a9fc-93d543fa2acd", + "__uuid__": "f8999765-2b3b-4d22-8a12-dd5165927db7", "__expectedType__": "cc.Prefab" }, "fileId": "fchELCmEtHhb3lT1fagDGR", @@ -2520,7 +2520,7 @@ }, { "__type__": "cc.PrefabInstance", - "fileId": "12xjG5e8hHN7DJgihsg6IV", + "fileId": "faxbl282RCv6dwC/vP5Ptz", "prefabRootNode": { "__id__": 1 }, @@ -2546,7 +2546,7 @@ "__id__": 121 }, "asset": { - "__uuid__": "2c62af7c-9b93-48ff-bd76-a2dfd799659e", + "__uuid__": "a4cde73d-6ad9-430a-9b55-6f16ff2da91e", "__expectedType__": "cc.Prefab" }, "fileId": "fchELCmEtHhb3lT1fagDGR", @@ -2557,7 +2557,7 @@ }, { "__type__": "cc.PrefabInstance", - "fileId": "abcYWp655FmJ4iRbui0zBn", + "fileId": "3aJFI/vHJH6Y9LOUbhbwF9", "prefabRootNode": { "__id__": 1 }, @@ -2594,7 +2594,7 @@ }, { "__type__": "cc.PrefabInstance", - "fileId": "3djpgjs39PzriOhREnUQuY", + "fileId": "50cmGOaoNCGLuqPybdqoCY", "prefabRootNode": { "__id__": 1 }, @@ -2629,7 +2629,7 @@ }, { "__type__": "cc.CompPrefabInfo", - "fileId": "17vENKB9JH+6TKFPKiMGXX" + "fileId": "87tYUJgsRKia3hRY2i2aH8" }, { "__type__": "cc.PrefabInfo", @@ -2639,7 +2639,7 @@ "asset": { "__id__": 0 }, - "fileId": "18O+j0S8xEYIv6WMXcyeIw", + "fileId": "a80xr2y8lMZ4MCN9QNPqd8", "instance": null, "targetOverrides": null, "nestedPrefabInstanceRoots": null @@ -2670,7 +2670,7 @@ }, { "__type__": "cc.CompPrefabInfo", - "fileId": "478Z8BuO5M75Jhu6GMpMhT" + "fileId": "30L9llCIlAS4dQy6Ps19i1" }, { "__type__": "cc.PrefabInfo", @@ -2680,7 +2680,7 @@ "asset": { "__id__": 0 }, - "fileId": "ebsIZE7xdDbb5tJoqarUox", + "fileId": "17rsA5ZVhEb7eBO3vu/Bso", "instance": null, "targetOverrides": null, "nestedPrefabInstanceRoots": null @@ -2711,7 +2711,7 @@ }, { "__type__": "cc.CompPrefabInfo", - "fileId": "4cQjGOFQlIQ6GxeL2bA2mr" + "fileId": "83qZ9QZ/ZIF7pJFrmkCcwC" }, { "__type__": "45522uB1sdFu4FJAojtnha4", @@ -2736,7 +2736,7 @@ }, { "__type__": "cc.CompPrefabInfo", - "fileId": "1f1eZxy3pBuJEJ6amYCj38" + "fileId": "8083N6zXdBe7547SaeWcIy" }, { "__type__": "cc.PrefabInfo", @@ -2746,7 +2746,7 @@ "asset": { "__id__": 0 }, - "fileId": "28c3VojQZGOLvCPh0RpLis", + "fileId": "9b4E1ihS5LVqIHaEHanm3b", "instance": null, "targetOverrides": null, "nestedPrefabInstanceRoots": null @@ -2936,7 +2936,7 @@ "__id__": 141 }, "asset": { - "__uuid__": "09ec107b-880c-45b8-ad98-84592e637c0b", + "__uuid__": "a185ad99-a791-4309-9851-549c756647b9", "__expectedType__": "cc.Prefab" }, "fileId": "fchELCmEtHhb3lT1fagDGR", @@ -2947,7 +2947,7 @@ }, { "__type__": "cc.PrefabInstance", - "fileId": "a4fHIOBRBJ6qq45d4LXQ+7", + "fileId": "36XjtDWgFL3JtqvPbvX2Pl", "prefabRootNode": { "__id__": 1 }, @@ -2973,7 +2973,7 @@ "__id__": 144 }, "asset": { - "__uuid__": "5347ef5a-5046-4c36-be8f-bb27dc475204", + "__uuid__": "c2de34b1-99b2-49c4-a6ec-44eeb63b12cd", "__expectedType__": "cc.Prefab" }, "fileId": "fchELCmEtHhb3lT1fagDGR", @@ -2984,7 +2984,7 @@ }, { "__type__": "cc.PrefabInstance", - "fileId": "4fafsMyrlKlKQA8BZ5qSP6", + "fileId": "baIoyp/uFHHbLCN8PMf0Nm", "prefabRootNode": { "__id__": 1 }, @@ -3010,7 +3010,7 @@ "__id__": 147 }, "asset": { - "__uuid__": "31e7557b-3a6b-4d2d-9daf-5a5e4b522638", + "__uuid__": "a0fd2fb6-af52-4b80-a9fc-93d543fa2acd", "__expectedType__": "cc.Prefab" }, "fileId": "fchELCmEtHhb3lT1fagDGR", @@ -3021,7 +3021,7 @@ }, { "__type__": "cc.PrefabInstance", - "fileId": "fb12V8nnlMrJi69PQDL8nL", + "fileId": "abskMPIQNAfais5oLYs3pu", "prefabRootNode": { "__id__": 1 }, @@ -3047,7 +3047,7 @@ "__id__": 150 }, "asset": { - "__uuid__": "09ec107b-880c-45b8-ad98-84592e637c0b", + "__uuid__": "e218006e-19e0-486f-b9db-e13d4c1f6cad", "__expectedType__": "cc.Prefab" }, "fileId": "fchELCmEtHhb3lT1fagDGR", @@ -3058,7 +3058,7 @@ }, { "__type__": "cc.PrefabInstance", - "fileId": "d2cjl4mUxAT7n8EK8ecj4B", + "fileId": "99utRz3GdH8o9gfwZ6YJ1m", "prefabRootNode": { "__id__": 1 }, @@ -3084,7 +3084,7 @@ "__id__": 153 }, "asset": { - "__uuid__": "5347ef5a-5046-4c36-be8f-bb27dc475204", + "__uuid__": "a0fd2fb6-af52-4b80-a9fc-93d543fa2acd", "__expectedType__": "cc.Prefab" }, "fileId": "fchELCmEtHhb3lT1fagDGR", @@ -3095,7 +3095,7 @@ }, { "__type__": "cc.PrefabInstance", - "fileId": "baO/kGo1JCwpWprr6jh8Xz", + "fileId": "87CUErQI5MzpP9aXtN6EuG", "prefabRootNode": { "__id__": 1 }, @@ -3130,7 +3130,7 @@ }, { "__type__": "cc.CompPrefabInfo", - "fileId": "c6zQoPNw5FWIW94rjfUgxO" + "fileId": "39UyhVsilFCb2QBT/94G7V" }, { "__type__": "cc.PrefabInfo", @@ -3140,7 +3140,7 @@ "asset": { "__id__": 0 }, - "fileId": "89VRlUiEtK2LFA2mwscg2z", + "fileId": "8dFDs3cYhENpglWpxl8m4o", "instance": null, "targetOverrides": null, "nestedPrefabInstanceRoots": null @@ -3171,7 +3171,7 @@ }, { "__type__": "cc.CompPrefabInfo", - "fileId": "8b4h3rb1tElr9U2qPk+p2R" + "fileId": "c0oGJp0VZJkYbPeZsuct/c" }, { "__type__": "cc.PrefabInfo", @@ -3181,7 +3181,7 @@ "asset": { "__id__": 0 }, - "fileId": "40m6spZ3RALJHqA4enwCoa", + "fileId": "8et4lufVNOkocraKuSvLnM", "instance": null, "targetOverrides": null, "nestedPrefabInstanceRoots": null @@ -3212,7 +3212,7 @@ }, { "__type__": "cc.CompPrefabInfo", - "fileId": "f9TCX9iF9DwJfmngxtGhnq" + "fileId": "a3926i8LxJyagXFXvVnyCv" }, { "__type__": "45522uB1sdFu4FJAojtnha4", @@ -3237,7 +3237,7 @@ }, { "__type__": "cc.CompPrefabInfo", - "fileId": "2dyDDK5chKsbilyzQompJ2" + "fileId": "e6oPAiGjhCba2cutJwbJUX" }, { "__type__": "cc.PrefabInfo", @@ -3247,7 +3247,7 @@ "asset": { "__id__": 0 }, - "fileId": "fbF8V45jJCwolzZ3tDoqKW", + "fileId": "1bcN98EoNPo5ALo0vZDJhY", "instance": null, "targetOverrides": null, "nestedPrefabInstanceRoots": null @@ -3437,7 +3437,7 @@ "__id__": 170 }, "asset": { - "__uuid__": "f8999765-2b3b-4d22-8a12-dd5165927db7", + "__uuid__": "79c428b2-5899-404c-8495-991b407ef71b", "__expectedType__": "cc.Prefab" }, "fileId": "fchELCmEtHhb3lT1fagDGR", @@ -3448,7 +3448,7 @@ }, { "__type__": "cc.PrefabInstance", - "fileId": "d3qwx5zDVAAo1sZargVLI8", + "fileId": "2cs2hIAFZDtYxsEb0FZHai", "prefabRootNode": { "__id__": 1 }, @@ -3474,7 +3474,7 @@ "__id__": 173 }, "asset": { - "__uuid__": "a4cde73d-6ad9-430a-9b55-6f16ff2da91e", + "__uuid__": "79c428b2-5899-404c-8495-991b407ef71b", "__expectedType__": "cc.Prefab" }, "fileId": "fchELCmEtHhb3lT1fagDGR", @@ -3485,7 +3485,7 @@ }, { "__type__": "cc.PrefabInstance", - "fileId": "7a1RNzDKlI9YrVm8FhaW1F", + "fileId": "44Ymic8JpBoqJG9+nK56ak", "prefabRootNode": { "__id__": 1 }, @@ -3511,7 +3511,7 @@ "__id__": 176 }, "asset": { - "__uuid__": "79c428b2-5899-404c-8495-991b407ef71b", + "__uuid__": "55a879b3-2ccd-48e3-bd43-c984e67f1637", "__expectedType__": "cc.Prefab" }, "fileId": "fchELCmEtHhb3lT1fagDGR", @@ -3522,7 +3522,7 @@ }, { "__type__": "cc.PrefabInstance", - "fileId": "2fvZjmDUdOcJycyPpF9a2X", + "fileId": "8a6icAKk5FBohZ8a2LTD+Y", "prefabRootNode": { "__id__": 1 }, @@ -3548,7 +3548,7 @@ "__id__": 179 }, "asset": { - "__uuid__": "f8999765-2b3b-4d22-8a12-dd5165927db7", + "__uuid__": "a185ad99-a791-4309-9851-549c756647b9", "__expectedType__": "cc.Prefab" }, "fileId": "fchELCmEtHhb3lT1fagDGR", @@ -3559,7 +3559,7 @@ }, { "__type__": "cc.PrefabInstance", - "fileId": "14ohW9VJFGVb9NQ3njN853", + "fileId": "80StY5XytJmo8uoW8qS3j1", "prefabRootNode": { "__id__": 1 }, @@ -3585,7 +3585,7 @@ "__id__": 182 }, "asset": { - "__uuid__": "2c62af7c-9b93-48ff-bd76-a2dfd799659e", + "__uuid__": "55a879b3-2ccd-48e3-bd43-c984e67f1637", "__expectedType__": "cc.Prefab" }, "fileId": "fchELCmEtHhb3lT1fagDGR", @@ -3596,7 +3596,7 @@ }, { "__type__": "cc.PrefabInstance", - "fileId": "939OBMe+lOV7aEaMckF1tU", + "fileId": "a5MaTSQINGFYk0CQ/Mp0Je", "prefabRootNode": { "__id__": 1 }, @@ -3631,7 +3631,7 @@ }, { "__type__": "cc.CompPrefabInfo", - "fileId": "b1fJVmWRpOMIUA71qQNfMv" + "fileId": "f3deLlKe1DfaNH2lPvt12/" }, { "__type__": "cc.PrefabInfo", @@ -3641,7 +3641,7 @@ "asset": { "__id__": 0 }, - "fileId": "d3jsJpm1VPCIsF8qcbADJ8", + "fileId": "f1HuBpV4JIlIPVM5l0Mf+S", "instance": null, "targetOverrides": null, "nestedPrefabInstanceRoots": null @@ -3672,7 +3672,7 @@ }, { "__type__": "cc.CompPrefabInfo", - "fileId": "e1ioF5KZBHSbW2v/adiCSS" + "fileId": "deWM0YWORAYJ/R2sojWU5+" }, { "__type__": "cc.PrefabInfo", @@ -3682,7 +3682,7 @@ "asset": { "__id__": 0 }, - "fileId": "8eQkc8rIFD7pg9mDAE8KUm", + "fileId": "b4IDrBS4ZNI60F3NT+isGj", "instance": null, "targetOverrides": null, "nestedPrefabInstanceRoots": null @@ -3713,7 +3713,7 @@ }, { "__type__": "cc.CompPrefabInfo", - "fileId": "ddP1hkh3hKIIqrVI/9mdly" + "fileId": "d157wKYNpApaGS7bO3W2ws" }, { "__type__": "45522uB1sdFu4FJAojtnha4", @@ -3738,7 +3738,7 @@ }, { "__type__": "cc.CompPrefabInfo", - "fileId": "dddgFJj9RB57rinAzqk5mW" + "fileId": "62gVkrtXpC8ps4HsizIvOl" }, { "__type__": "cc.PrefabInfo", @@ -3748,7 +3748,7 @@ "asset": { "__id__": 0 }, - "fileId": "df/8gYQMBK46BQsHVtCAOL", + "fileId": "b9nvNFjspOYJAGxjRW6bVK", "instance": null, "targetOverrides": null, "nestedPrefabInstanceRoots": null @@ -3949,7 +3949,7 @@ }, { "__type__": "cc.PrefabInstance", - "fileId": "16AkGySf1F04bb5tkMW1cv", + "fileId": "1deCY+kyFFB6abquVhy1hG", "prefabRootNode": { "__id__": 1 }, @@ -3986,7 +3986,7 @@ }, { "__type__": "cc.PrefabInstance", - "fileId": "a311Q/pQlKKJ5zRDjzTiiw", + "fileId": "afGuFvw2hAkbnvx9PaGs85", "prefabRootNode": { "__id__": 1 }, @@ -4023,7 +4023,7 @@ }, { "__type__": "cc.PrefabInstance", - "fileId": "edZF2mO6hOv5XaFfv1znIn", + "fileId": "8d6TGu5MxPVZWbkusbwnLm", "prefabRootNode": { "__id__": 1 }, @@ -4049,7 +4049,7 @@ "__id__": 208 }, "asset": { - "__uuid__": "a4cde73d-6ad9-430a-9b55-6f16ff2da91e", + "__uuid__": "2c62af7c-9b93-48ff-bd76-a2dfd799659e", "__expectedType__": "cc.Prefab" }, "fileId": "fchELCmEtHhb3lT1fagDGR", @@ -4060,7 +4060,7 @@ }, { "__type__": "cc.PrefabInstance", - "fileId": "b00Z42nKBBi6LlSzJsKFkb", + "fileId": "02p2yt1sxJ3Jvu+B8QypzM", "prefabRootNode": { "__id__": 1 }, @@ -4086,7 +4086,7 @@ "__id__": 211 }, "asset": { - "__uuid__": "31e7557b-3a6b-4d2d-9daf-5a5e4b522638", + "__uuid__": "2c62af7c-9b93-48ff-bd76-a2dfd799659e", "__expectedType__": "cc.Prefab" }, "fileId": "fchELCmEtHhb3lT1fagDGR", @@ -4097,7 +4097,7 @@ }, { "__type__": "cc.PrefabInstance", - "fileId": "e8zmwRD7pFIpKo8XAsnA+a", + "fileId": "31iC7CHShC3YR8Mk3qT+Sg", "prefabRootNode": { "__id__": 1 }, @@ -4132,7 +4132,7 @@ }, { "__type__": "cc.CompPrefabInfo", - "fileId": "c2Mo68zvRPSYUurb1+ogHi" + "fileId": "8dYvHCNB9B/5SPNbsmz+G4" }, { "__type__": "cc.PrefabInfo", @@ -4142,7 +4142,7 @@ "asset": { "__id__": 0 }, - "fileId": "e7hdJbvkhGapaf7m2ex5gN", + "fileId": "d73VqgFhpD/7cgxSqnVbzv", "instance": null, "targetOverrides": null, "nestedPrefabInstanceRoots": null @@ -4173,7 +4173,7 @@ }, { "__type__": "cc.CompPrefabInfo", - "fileId": "14lO/V5ctPwK2vIbivTOlO" + "fileId": "a9pwN9Az5NVbBY/pRTuWTg" }, { "__type__": "cc.PrefabInfo", @@ -4183,7 +4183,7 @@ "asset": { "__id__": 0 }, - "fileId": "a3jHXR06NGCo5/PI0WmJqS", + "fileId": "85WhqXi5ZF172AE5XhuYHy", "instance": null, "targetOverrides": null, "nestedPrefabInstanceRoots": null @@ -4214,7 +4214,7 @@ }, { "__type__": "cc.CompPrefabInfo", - "fileId": "d1lGgmDuBPWYGx0q2M6FLn" + "fileId": "51sRPJ0FhPCL5sPqbEZuvC" }, { "__type__": "45522uB1sdFu4FJAojtnha4", @@ -4239,7 +4239,7 @@ }, { "__type__": "cc.CompPrefabInfo", - "fileId": "03xDhQiORAN7kF/MwQ5/tn" + "fileId": "b4R+HefTdLioAFpcUEl1kG" }, { "__type__": "cc.PrefabInfo", @@ -4249,7 +4249,7 @@ "asset": { "__id__": 0 }, - "fileId": "42jqkDgjBBgrNvZtDqHS4l", + "fileId": "8eP7L/e9xIuakeObL8+QZA", "instance": null, "targetOverrides": null, "nestedPrefabInstanceRoots": null @@ -4274,7 +4274,7 @@ }, { "__type__": "cc.CompPrefabInfo", - "fileId": "83Wng+vXFDgZ49AGdleAdZ" + "fileId": "54n49UzFpOmq6htVxAvK/b" }, { "__type__": "cc.UITransform", @@ -4302,7 +4302,7 @@ }, { "__type__": "cc.CompPrefabInfo", - "fileId": "16fiOudSRLfYNOBht5EFbg" + "fileId": "bcfH+xTk1D+JdsHdRJxeqw" }, { "__type__": "cc.Sprite", @@ -4347,7 +4347,7 @@ }, { "__type__": "cc.CompPrefabInfo", - "fileId": "3e3qqaDiJMhqs6xb3u61uD" + "fileId": "91P54An/1L77Wfbiwa5xWb" }, { "__type__": "cc.PrefabInfo", @@ -4357,7 +4357,7 @@ "asset": { "__id__": 0 }, - "fileId": "2ervHqoyJJPKs6YTyr/bwI", + "fileId": "bbs1z4Ji5NiZRcndGPNfTx", "instance": null, "targetOverrides": null, "nestedPrefabInstanceRoots": null diff --git a/assets/Game/scripts/SlotGame.ts b/assets/Game/scripts/SlotGame.ts index 8d1a986..75ba712 100644 --- a/assets/Game/scripts/SlotGame.ts +++ b/assets/Game/scripts/SlotGame.ts @@ -305,11 +305,14 @@ export class SlotGame extends Component { // 遍历CrossSymbolColorChange获取颜色变化信息 for (let key in this.spinData.Change.Details) { - if (!this.spinData.Change.Details[key].Symbol) { - return + //判断组合块是否发生了金变百搭 + let newIndex = -1; + if (this.spinData.Change.Details[key].Symbol) { + newIndex = this.spinData.Change.Details[key].Symbol.New + } else { + let newPos = this.spinData.Change.Details[key].Pos.New[0] + newIndex = this.spinData.Symbol.Middle[newPos] } - // let colorChange = this.spinData.PanChanges.CrossSymbolColorChange[key]; - let newIndex = this.spinData.Change.Details[key].Symbol.New; let oldStartPos; let frameType; let height; @@ -345,8 +348,15 @@ export class SlotGame extends Component { // 消除创建的逻辑 createNewIconTop(spinData: any) { this.spinData = spinData; - let createDatas = this.spinData.Change.Middle; - this.rollerManager.createNewIconTop([...createDatas]); + let createDatas: number[][][] = [[[]]] + let CroSymbols = null + if (this.spinData.Change) { + createDatas = this.spinData.Change.Middle; + } + if (this.spinData.CroSymbols) { + CroSymbols = this.spinData.CroSymbols + } + this.rollerManager.createNewIconTop(createDatas, CroSymbols); } // icon掉落的逻辑 diff --git a/assets/Game/scripts/SlotScene.ts b/assets/Game/scripts/SlotScene.ts index f41fc7e..def115e 100644 --- a/assets/Game/scripts/SlotScene.ts +++ b/assets/Game/scripts/SlotScene.ts @@ -7,7 +7,7 @@ import { SLOT_GAME_EVENT, SYS_GIFT, WIN_TYPE, - winTestData, + TestData, } from "./game/Define"; import { SlotBar } from "./SlotBar"; import { SlotGame } from "./SlotGame"; @@ -203,7 +203,7 @@ export class SlotScene extends Component { this.checkHasEliminate(); if (this.gameState.isInFreeSpin) { - this.slotBar.enterFreeSpin(this.spinData.FreeSpin.LeftCount); + this.slotBar.enterFreeSpin(this.spinData.Free.LeftCount); } this.slotBar.reconnectState(true); this.slotGame.changeBg(this.gameState.isInFreeSpin); @@ -326,7 +326,7 @@ export class SlotScene extends Component { // this.SysGift.handleSysInfoFreeCount(this.spinInfo.Frb.Ongoing.Frn); // } } else { - this.spinInfo = winTestData; + this.spinInfo = TestData; } if (this.TipPanel.getHasTip()) { @@ -502,12 +502,12 @@ export class SlotScene extends Component { if (isExpect) { this.slotGame.playScatterAni(() => { this.FreeSpinEnter.show( - this.spinInfo.Data.FreeSpin.MaxCount, + this.spinInfo.Data.Free.MaxCount, () => { AudioManager.instance.playBGM("Free_Mode_BGM"); this.slotGame.changeBg(true); this.slotBar.enterFreeSpin( - this.spinInfo.Data.FreeSpin.LeftCount + this.spinInfo.Data.Free.LeftCount ); this.scheduleOnce(() => { this.freeSpinStop(); @@ -524,9 +524,9 @@ export class SlotScene extends Component { ); if (isExpect) { this.slotGame.playScatterAni(() => { - this.FreeSpinAdd.show(this.spinInfo.Data.GetGamesTimes, () => { + this.FreeSpinAdd.show(this.spinInfo.Data.GamesTimes, () => { this.slotBar.showLeftCount( - this.spinInfo.Data.FreeSpin.LeftCount + this.spinInfo.Data.Free.LeftCount ); this.scheduleOnce(() => { this.freeSpinStop(); @@ -612,11 +612,11 @@ export class SlotScene extends Component { this.slotGame.playScatterAni(() => { // 第一次进入免费旋转需要切换背景和展示免费次数 this.FreeSpinEnter.show( - this.spinInfo.Data.FreeSpin.MaxCount, + this.spinInfo.Data.Free.MaxCount, () => { this.slotGame.changeBg(true); this.slotBar.enterFreeSpin( - this.spinInfo.Data.FreeSpin.LeftCount + this.spinInfo.Data.Free.LeftCount ); this.scheduleOnce(() => { this.freeSpinStop(); @@ -634,9 +634,9 @@ export class SlotScene extends Component { if (isExpect) { this.slotGame.rollerManager.checkNextRollerExpect(6, 4); this.slotGame.playScatterAni(() => { - this.FreeSpinAdd.show(this.spinInfo.Data.GetGamesTimes, () => { + this.FreeSpinAdd.show(this.spinInfo.Data.GamesTimes, () => { this.slotBar.showLeftCount( - this.spinInfo.Data.FreeSpin.LeftCount + this.spinInfo.Data.Free.LeftCount ); this.scheduleOnce(() => { this.freeSpinStop(); @@ -667,7 +667,7 @@ export class SlotScene extends Component { } checkHasGame() { - let freeSpinData = this.spinData.FreeSpin; + let freeSpinData = this.spinData.Free; this.gameState.isInFreeSpin = freeSpinData != null; if (this.gameState.isInFreeSpin) { if (freeSpinData.LeftCount == freeSpinData.MaxCount) { @@ -685,7 +685,7 @@ export class SlotScene extends Component { } checkHasMoreScatter() { - return this.spinData.GetGamesTimes > 0; + return this.spinData.GamesTimes > 0; } private async normalStop(isReconnect: boolean = false) { @@ -698,12 +698,12 @@ export class SlotScene extends Component { } private async freeSpinStop(isReconnect: boolean = false) { - let leftCount = this.spinData.FreeSpin.LeftCount; + let leftCount = this.spinData.Free.LeftCount; if (leftCount >= 1) { let score = 0; if (this.spinData.RoundInfo != null) { - score = this.spinData.RoundInfo.AllScore; + score = this.spinData.RoundInfo.Score; } let winType = this.slotGame.checkWinType(score); await this.handleOngoingFreeSpin(leftCount, winType); @@ -717,7 +717,7 @@ export class SlotScene extends Component { let score = 0; let time = 1; if (this.spinData.RoundInfo != null) { - score = this.spinData.RoundInfo.AllScore; + score = this.spinData.RoundInfo.Score; time = 3; } let winType = this.slotGame.checkWinType(score); @@ -823,7 +823,7 @@ export class SlotScene extends Component { // 3,4,5 this.scheduleOnce(() => { let score = isFreeSpin - ? this.spinData.RoundInfo.AllScore + ? this.spinData.RoundInfo.Score : this.spinData.AllScore; if (winType >= WIN_TYPE.BIG_WIN) { this.BigWinUI.setCloseCallBack(() => { diff --git a/assets/Game/scripts/game/BaseRoller.ts b/assets/Game/scripts/game/BaseRoller.ts index 7150540..f8dfd66 100644 --- a/assets/Game/scripts/game/BaseRoller.ts +++ b/assets/Game/scripts/game/BaseRoller.ts @@ -647,7 +647,7 @@ export abstract class BaseRoller extends Component { abstract chanegeIconAndFrameType(data: any[]): void; - abstract createNewIconTop(createDatas: number[][]): void; + abstract createNewIconTop(createDatas: number[][], CroSymbols: any): void; abstract iconFallDown(data: number[], CroSymbols: any): void; } \ No newline at end of file diff --git a/assets/Game/scripts/game/Define.ts b/assets/Game/scripts/game/Define.ts index df3fae5..5c52ce6 100644 --- a/assets/Game/scripts/game/Define.ts +++ b/assets/Game/scripts/game/Define.ts @@ -597,7 +597,7 @@ export let winData: any = { } } -export let winTestData = { +export let TestData = { "Balance": 512890548700, "Data": { "Rid": "67da7b0e3fb9bd4878ff44d2_7_21", diff --git a/assets/Game/scripts/game/HRoller.ts b/assets/Game/scripts/game/HRoller.ts index 383fdab..2c43946 100644 --- a/assets/Game/scripts/game/HRoller.ts +++ b/assets/Game/scripts/game/HRoller.ts @@ -1,799 +1,799 @@ -/** - * 负责单个滚轮的创建、滚动、停止等逻辑 - */ -import { - _decorator, - Node, - UITransform, - Vec2, - v2, - Vec3, - v3, - tween, - Tween, - Mask, -} from 'cc'; -import { IconFactory } from './IconFactory'; -import { Icon } from './Icon'; -import { BaseRoller, ROLLER_STATE } from './BaseRoller'; -import { ROLLER_EVENT } from './Define'; -import { callGameApi } from 'db://assets/Loading/scripts/comm'; - -let { ccclass, property, executeInEditMode } = _decorator; - -/** - * 滚轮组件类 - */ -@ccclass('HRoller') -@executeInEditMode -export class HRoller extends BaseRoller { - - // 编辑器属性 - @property({ tooltip: '列数' }) - col: number = 3; - - // 本地格式化相关 - @property - _format = false; - @property({ tooltip: '本地格式化' }) - get format(): boolean { - return this._format; - } - set format(b: boolean) { - this._format = b; - this.resizeContentSize(); - - if (!this.iconFactory) { - console.error('IconFactory没有设置'); - return; - } - - // 重新创建图标 - this._content.removeAllChildren(); - this._info.icons = []; - this._allIcons.clear(); - this._posToIconKey.clear(); - // 清除位置缓存 - 添加这一行 - this._positionCache.clear(); - - for (let i = 0; i < this.col; i++) { - let randomIndex = Math.floor(Math.random() * this.iconFactory.getIconNum()); - this.createNormalIcon(i, randomIndex); - } - } - - _cachedContentWidth: number = 0; - _cachedAnchorX: number = 0; - - /** - * 创建滚轮实例 - * @param id 滚轮ID - * @param row 行数 - * @param iconWidth 图标宽度 - * @param iconHeight 图标高度 - * @param iconFactory 图标工厂实例 - * @param anchor 锚点位置 - * @returns 新创建的滚轮实例 - */ - static create( - id: number, - col: number, - iconWidth: number, - iconHeight: number, - iconFactory: IconFactory, - anchor: Vec2 = v2(0.5, 0.5) - ): HRoller { - let rollerNode = new Node(`Roller${id}`); - rollerNode.addComponent(UITransform); - - let roller = rollerNode.addComponent(HRoller); - roller._rollerId = id; - roller.col = col; - roller.iconWidth = iconWidth; - roller.iconHeight = iconHeight; - roller.iconFactory = iconFactory; - - rollerNode.getComponent(UITransform).setAnchorPoint(anchor); - roller.resizeContentSize(); - roller.initRoller(id); - return roller; - } - - /** - * 设置节点尺寸和位置 - */ - setupNodesSizeAndPosition() { - let totalWidth = this.iconWidth * this.col; - let anchorPoint = this.node.getComponent(UITransform).anchorPoint; - - // 设置主节点尺寸 - this.node.getComponent(UITransform).setContentSize(totalWidth, this.iconHeight); - - // 设置view节点 - this._view.setPosition(0, 0); - this._view.getComponent(UITransform).setContentSize(totalWidth, this.iconHeight); - this._view.getComponent(UITransform).setAnchorPoint(anchorPoint); - this._view.getComponent(UITransform).height *= 2; - - // 设置content节点 - this._content.setPosition(0, 0); - this._content.getComponent(UITransform).setContentSize(totalWidth, this.iconHeight); - this._content.getComponent(UITransform).setAnchorPoint(anchorPoint); - this._content.removeAllChildren(); - } - - /** - * 获取图标的实际坐标 - * @param pos 图标位置索引 - * @param height 图标高度 - * @returns 图标的世界坐标 - */ - getIconPosition(pos: number, size: number = 1): Vec3 { - // 创建缓存键 - let cacheKey = size > 1 ? (pos + 1) * 1000 + size : pos; - - if (this._positionCache.has(cacheKey)) { - return this._positionCache.get(cacheKey).clone(); - } - - // 确保缓存数据已初始化 - if (!this._cachedContentWidth) { - this._cachedContentWidth = this._content.getComponent(UITransform).width; - this._cachedAnchorX = this._content.getComponent(UITransform).anchorX; - } - - // 计算基准位置 - let contentWidth = this._cachedContentWidth; - let anchorX = this._cachedAnchorX; - - // 计算最左边位置 - let leftX = -contentWidth * (1 - anchorX); - - // 计算第一个位置的中心x坐标 - let firstCenterX = leftX + this.iconWidth / 2; - - // 计算当前位置的中心X坐标 - let centerX = firstCenterX + pos * this.iconWidth; - - // 对于大图标,需要调整位置 - let finalX = centerX; - if (size > 1) { - // 大图标的中心点应该下移,使其顶部对齐格子 - // 对于高度为3的图标,中心点应该下移1个格子高度 - finalX = centerX + (size - 1) * this.iconWidth / 2; - } - - // 创建最终位置 - let position = v3(finalX, 0, 0); - - // 缓存结果 - this._positionCache.set(cacheKey, position.clone()); - return position; - } - - /** - * 初始化性能优化相关的缓存 - */ - initCache() { - this._cachedUITransform = this._content.getComponent(UITransform); - this._cachedContentWidth = this._cachedUITransform.width; - this._cachedAnchorX = this._cachedUITransform.anchorX; - } - - /** - * 收集现有图标 - */ - collectExistingIcons() { - for (let i = 0; i < this.col; i++) { - let icon = this._allIcons.get(this._posToIconKey.get(i)); - if (icon) { - this._allIcons.delete(this._posToIconKey.get(i)); - this._posToIconKey.delete(i); - this._info.icons.push(icon); - } - } - } - - /** - * 手动停止滚动 - * @param data 停止时的图标数据 - */ - async manualStopScroll(data: number[]) { - if (this._info.isManualStop || - this._info.state === ROLLER_STATE.STOP) { - return; - } - - this.changeState(ROLLER_STATE.STOP); - this._info.resetLxInfo(); - this._stopData = data; - this._info.isManualStop = true; - Tween.stopAllByTarget(this._info.speedNode); - - // 直接回收所有动态图标 - while (this._info.icons.length > 0) { - let icon = this._info.icons.pop(); - this.iconFactory.recycleIcon(icon); - } - - // 回收固定位置图标 - for (let i = 0; i < this.col; i++) { - let icon = this._allIcons.get(this._posToIconKey.get(i)); - if (icon) { - this._allIcons.delete(this._posToIconKey.get(i)); - this._posToIconKey.delete(i); - this.iconFactory.recycleIcon(icon); - } - } - this._allIcons.clear(); - this._posToIconKey.clear(); - - this.createInitIcons(data); - // 为所有创建的图标播放动画 - for (let icon of this._allIcons.values()) { - icon.getComponent(Icon).playSpawnAni(); - } - } - - /** - * 创建最后一页图标 - */ - createLastPage() { - let data = this._stopData; - if (!data) return; - - // 计算最右边icon基准位置 - let rightX = this.getIconPosition(this.col - 1).x; - let icons = this._info.icons; - if (icons.length > 0) { - rightX = Math.max(rightX, this.findHighestIconXorY(icons)); - } - - // 清除已有的位置映射,准备重新创建 - this._allIcons.clear(); - this._posToIconKey.clear(); - - // 从左到右依次创建图标(从位置0开始) - for (let i = 0; i < data.length; i++) { - // 如果当前位置已被特殊图标占用,跳过 - if (this._posToIconKey.has(i)) continue; - - // 生成图标ID - let pos = i; - let iconIndex = data[i]; - let iconKey = this.generateIconKey(pos, 1, pos); - - // 创建图标节点 - let icon = this.iconFactory.icfactoryCreateIcon(iconIndex); - icon.getComponent(Icon).initIcon(iconIndex, 1, iconKey, 0, this._rollerId); - - // 计算位置 - let x = rightX + (pos + 1) * this.iconWidth; - icon.setPosition(x, 0, 0); - - this._content.addChild(icon); - - // 存储图标节点 - this._allIcons.set(iconKey, icon); - this._posToIconKey.set(pos, iconKey); - - } - this.node.emit(ROLLER_EVENT.LAST_PAGE_CREATE, this._rollerId); - } - - - /** - * 检查图标是否超出显示范围 - */ - checkDeadLine(icon: Node): boolean { - if (!this._cachedContentWidth) { - this._cachedContentWidth = this._content.getComponent(UITransform).width; - this._cachedAnchorX = this._content.getComponent(UITransform).anchorX; - } - - let iconComponent = icon.getComponent(Icon); - let lheight = iconComponent.lHeight; - let iconBody = (lheight - 1) * this.iconWidth + this.iconWidth / 2; - let deadLine = -(this._cachedContentWidth * this._cachedAnchorX) - iconBody; - - return icon.position.x <= deadLine; - } - - /** - * 补充新的图标 - */ - suppleIcon() { - let bornLine = this.getIconPosition(this.col - 1).x; - let icons = this._info.icons; - - // 找到最右边的的图标X坐标 - let rightX = this.findHighestIconXorY(icons); - - // 如果最右边的图标低于出生线,创建新图标 - if (rightX < bornLine) { - this.createRandomIcon(); - } - } - - - /** - * 创建随机图标 - */ - createRandomIcon() { - let iconIndex = this.getRandomIconIndex(); - let newX = this.computeNewIconXorY(); - let icon = this.iconFactory.icfactoryCreateIcon(iconIndex); - - // 设置快速图标效果 - if (this.shouldShowFastIcon()) { - icon.getComponent(Icon).showFastIcon(true); - } - icon.setPosition(newX, 0, 0); - this._content.addChild(icon); - - - this._info.icons.push(icon); - this.node.emit(ROLLER_EVENT.ON_R_ICON_CREATE, this._rollerId, icon); - } - - - /** - * 找到最右边的图标X坐标 - * @param icons 图标数组 - * @returns 最右边的X坐标 - */ - findHighestIconXorY(icons: Node[]): number { - return icons.reduce((maxX, icon) => { - if (!icon || !icon.active) return maxX; - - let iconComponent = icon.getComponent(Icon); - if (!iconComponent) return maxX; - - let lHeight = iconComponent.lHeight || 1; - let iconX = icon.position.x; - - // 对于高度大于1的图标,考虑其顶部位置 - if (lHeight > 1) { - // 计算图标顶部位置:当前位置 + 高度差 * 图标高度 / 2 - return Math.max(maxX, iconX + (lHeight - 1) * this.iconWidth / 2); - } else { - return Math.max(maxX, iconX); - } - }, -999); - } - - - - /** - * 计算新图标的X坐标 - */ - computeNewIconXorY(): number { - let icons = this._info.icons; - - // 如果没有图标,使用初始位置 - if (!icons.length) { - return this.getIconPosition(this.col - 1).x + this.iconWidth; - } - - // 找到最右边的图标X坐标 - let rightX = this.findHighestIconXorY(icons); - - // 新图标位置 = 最高图标位置 + 图标高度 - return rightX + this.iconWidth; - } - - /** - * 清理资源 - */ - onDestroy() { - this._cachedUITransform = null; - this._cachedContentWidth = 0; - this._cachedAnchorX = 0; - this._positionCache.clear(); - } - - /** - * 滚轮移动 - * @param dt 时间增量 - */ - rollerMove(dt: number) { - // 计算移动向量 - let speed = this._info.speed; - let move = speed * dt; - let moveVec = v3(move, 0, 0); - - - - // 更新动态图标位置 - this._info.icons.forEach(icon => { - if (!icon || !icon.isValid) return; - - if (icon.active) { - let newPosition = icon.position.clone().subtract(moveVec); - icon.setPosition(newPosition); - } - }); - // 获取所有图标 - let allIcons = Array.from(this._allIcons.values()); - allIcons.forEach(icon => { - if (!icon || !icon.isValid) return; - let newPosition = icon.position.clone().subtract(moveVec); - icon.setPosition(newPosition); - }); - - - } - - /** - * 回收滚轮图标 - */ - recycleRollerIcon() { - // 回收动态图标 - let icons = this._info.icons; - for (let i = icons.length - 1; i >= 0; i--) { - let icon = icons[i]; - if (!icon || !icon.isValid) { - icons.splice(i, 1); - continue; - } - - if (this.checkDeadLine(icon)) { - // 从数组中移除 - icons.splice(i, 1); - // 回收图标 - this.iconFactory.recycleIcon(icon); - } - } - - // 回收固定位置图标(非最后一页创建状态) - if (this._info.state !== ROLLER_STATE.LAST_PAGE_CREATE) { - for (let i = 0; i < this.col; i++) { - let iconKey = this._posToIconKey.get(i); - if (!iconKey) continue; - - let icon = this._allIcons.get(iconKey); - if (!icon || !icon.isValid) { - this._posToIconKey.delete(i); - this._allIcons.delete(iconKey); - continue; - } - - if (this.checkDeadLine(icon)) { - // 从映射中移除 - this._allIcons.delete(iconKey); - this._posToIconKey.delete(i); - // 回收图标 - this.iconFactory.recycleIcon(icon); - } - } - } - - // 处理特殊图标(n*1图标) - if (this._info.state !== ROLLER_STATE.LAST_PAGE_CREATE) { - // 获取所有特殊图标的key - let specialIconKeys = Array.from(this._allIcons.keys()) - .filter(key => key.startsWith('large_')); - - for (let iconKey of specialIconKeys) { - let icon = this._allIcons.get(iconKey); - if (!icon || !icon.isValid) { - this._allIcons.delete(iconKey); - continue; - } - - if (this.checkDeadLine(icon)) { - // 从映射中移除 - this._allIcons.delete(iconKey); - - // 移除所有关联的位置映射 - for (let [pos, key] of this._posToIconKey.entries()) { - if (key === iconKey) { - this._posToIconKey.delete(pos); - } - } - - // 回收图标 - this.iconFactory.recycleIcon(icon); - } - } - } - } - - - - /** - * 停止处理 - */ - stopProcess() { - let rightIcon = this.getIconPosition(this.col - 1); - let stopline = rightIcon.x - 100; // 偏移量100 - let topX = this.findHighestIconXorY(Array.from(this._allIcons.values())); - - if (topX <= stopline) { - this.changeState(ROLLER_STATE.BOUNCE); - this.playBounceAnimation(); - } - } - - /** - * 播放回弹动画 - */ - playBounceAnimation() { - let time = 0.1; - let offset = 50; - - // 获取所有图标 - let allIcons = Array.from(this._allIcons.values()); - - allIcons.forEach(icon => { - - if (!icon || !icon.isValid) return; - - let iconComponent = icon.getComponent(Icon); - if (!iconComponent) return; - - // 获取图标的起始位置和高度 - let startPos = iconComponent.startPos; - let lHeight = iconComponent.lHeight || 1; - - // 获取图标应该在的位置 - let position = this.getIconPosition(startPos, lHeight); - - // 设置初始位置(向下偏移) - // icon.setPosition(position.add(v3(-offset, 0, 0))); - icon.setPosition(position); - iconComponent.playSpawnAni(); - - // 创建回弹动画 - // tween(icon) - // .by(time, { position: v3(offset, 0, 0) }) - // .start(); - }); - - // 延迟切换到停止状态 - this.scheduleOnce(() => { - this.changeState(ROLLER_STATE.STOP); - }, time); - } - - /** - * 消除逻辑 - * 一定是在静止状态消除的 - * @param deleteMsg 删除信息 - * */ - deleteIconNode(positions: number[]) { - // 记录被处理过的图标键 - let processedPos = new Set(); - - // 处理每个位置 - for (let pos of positions) { - // 如果此图标已处理过,跳过 - if (processedPos.has(pos)) { - continue; - } - let iconKey = this._posToIconKey.get(pos); - if (!iconKey) { - console.error('deleteIconNode iconKey is null', pos); - continue; - } - - - - let iconNode = this._allIcons.get(iconKey); - if (!iconNode || !iconNode.isValid) { - console.error('deleteIconNode iconNode is null', pos); - continue; - } - - let iconComponent = iconNode.getComponent(Icon); - if (!iconComponent) { - console.error('deleteIconNode iconComponent is null', pos); - continue; - } - - - let startPos = iconComponent.startPos; - // 从allIcons中删除图标 - this._allIcons.delete(iconKey); - - let height = iconComponent.lHeight || 1; - // 移除所有关联的位置映射 - if (height > 1) { - // 对于n*1图标,需要清除所有占用的位置 - for (let i = 0; i < height; i++) { - this._posToIconKey.delete(startPos + i); - // 标记此图标已处理 - processedPos.add(startPos + i); - } - } else { - this._posToIconKey.delete(pos); - // 标记此图标已处理 - processedPos.add(pos); - - } - iconComponent.playWinAni(true); - iconComponent.playDeleteAni(); - this.scheduleOnce(() => { - this.iconFactory.recycleIcon(iconNode); - }, 1.2) - } - - this.node.emit(ROLLER_EVENT.ICON_DELETED, this._rollerId); - } - - playFrameTypeChangeAni(positions: number[]): void { - for (let pos of positions) { - - let iconKey = this._posToIconKey.get(pos); - if (!iconKey) continue; - - let iconNode = this._allIcons.get(iconKey); - if (!iconNode || !iconNode.isValid) continue; - - let iconComponent = iconNode.getComponent(Icon); - if (!iconComponent) continue; - - iconComponent.playWinAni(true); - } - } - - chanegeIconAndFrameType(data: any[]): void { - return; - } - - /** - * 创建新icon - * @param createMsg 信息 - */ - createNewIconTop(createDatas: number[]) { - // 获取所有图标 - let rightX = this.getIconPosition(this.col - 1, 1).x; - for (let i = 0; i < createDatas.length; i++) { - let pos = this.col + i + 1; - let iconIndex = createDatas[i]; - let iconKey = this.generateIconKey(pos, 1, pos); - let icon = this.iconFactory.icfactoryCreateIcon(iconIndex); - icon.getComponent(Icon).initIcon(iconIndex, 1, iconKey, 0, this._rollerId); - - let x = rightX + (i + 1) * this.iconWidth; - icon.setPosition(x, 0, 0); - this._content.addChild(icon); - - this._allIcons.set(iconKey, icon); - this._posToIconKey.set(pos, iconKey); - } - this.node.emit(ROLLER_EVENT.ICON_CREATE, this._rollerId); - } - - - /** icon进行掉落移动 */ - iconFallDown(data: number[], CroSymbols: any) { - // 更新所有icon的iconKey和posToIconKey - - let updates = []; - let sortNewIconStartPos = this.getNewIconsStartPos(data, CroSymbols); - let sortIcons = this.getSortIcons(); - for (let i = 0; i < sortNewIconStartPos.length; i++) { - let newStartPos = sortNewIconStartPos[i]; - let oldIcon = sortIcons[i]; - let oldIconStartPos = oldIcon.startPos; - - - if (oldIconStartPos === newStartPos) { - continue; - } - let oldIconNode = oldIcon.icon; - let oldIconComponent = oldIcon.component; - let oldIconkey = oldIconComponent.iconKey; - let lHeight = oldIconComponent.lHeight || 1; - let newIconkey = this.generateIconKey(newStartPos, 1, newStartPos); - let newX = this.getIconPosition(newStartPos, lHeight).x; - let oldX = oldIconNode.position.x; - - updates.push({ - node: oldIconNode, - component: oldIconComponent, - oldKey: oldIconkey, - oldStartPos: oldIconStartPos, - newStartPos: newStartPos, - newKey: newIconkey, - height: lHeight - }) - - - let time = 0.3; - tween(oldIconNode) - .to(time, { position: v3(newX, 0, 0) }) - .start(); - } - - for (let update of updates) { - this._allIcons.delete(update.oldKey); - for (let i = 0; i < update.height; i++) { - this._posToIconKey.delete(update.oldStartPos + i); - } - } - - // 再添加所有新映射 - for (let update of updates) { - // 添加新的映射 - update.component.iconKey = update.newKey; - this._allIcons.set(update.newKey, update.node); - for (let i = 0; i < update.height; i++) { - this._posToIconKey.set(update.newStartPos + i, update.newKey); - } - } - this.scheduleOnce(() => { - this.node.emit(ROLLER_EVENT.ICON_FALLEN, this._rollerId); - }, 0.5) - } - - - getSortIcons() { - let iconInfos: { icon: Node, component: Icon, startPos: number }[] = []; - - // 收集所有图标信息 - for (let [iconKey, iconNode] of this._allIcons.entries()) { - if (!iconNode || !iconNode.isValid) continue; - - let iconComponent = iconNode.getComponent(Icon); - if (!iconComponent) continue; - - // 记录图标信息 - iconInfos.push({ - icon: iconNode, - component: iconComponent, - startPos: iconComponent.startPos - }); - } - - // 按startPos从小到大排序 - iconInfos.sort((a, b) => a.startPos - b.startPos); - - return iconInfos; - } - - - - getNewIconsStartPos(data: number[], CroSymbols: any) { - // 存储所有图标的startPos - let startPositions: number[] = []; - - // 记录已处理的位置 - let processedPositions = new Set(); - // 记录已经处理的pos - let processedPos = new Set(); - // 首先处理不规则图标(n*1图标) - if (CroSymbols) { - for (let pos in CroSymbols) { - let id = CroSymbols[pos].id; - if (processedPos.has(id)) continue; - processedPos.add(id); - let iconSpecialMsg = CroSymbols[pos]; - let startPos = iconSpecialMsg.startPos; - let endPos = iconSpecialMsg.endPos; - - // 添加不规则图标的startPos - startPositions.push(startPos); - - // 标记所有被占用的位置 - for (let i = startPos; i <= endPos; i++) { - processedPositions.add(i); - } - } - } - - // 然后处理常规图标 - for (let i = 0; i < data.length; i++) { - // 如果该位置未被处理(不是不规则图标的一部分) - if (!processedPositions.has(i)) { - startPositions.push(i); - } - } - - // 从小到大排序 - startPositions.sort((a, b) => a - b); - return startPositions; - } - -} +// /** +// * 负责单个滚轮的创建、滚动、停止等逻辑 +// */ +// import { +// _decorator, +// Node, +// UITransform, +// Vec2, +// v2, +// Vec3, +// v3, +// tween, +// Tween, +// Mask, +// } from 'cc'; +// import { IconFactory } from './IconFactory'; +// import { Icon } from './Icon'; +// import { BaseRoller, ROLLER_STATE } from './BaseRoller'; +// import { ROLLER_EVENT } from './Define'; +// import { callGameApi } from 'db://assets/Loading/scripts/comm'; + +// let { ccclass, property, executeInEditMode } = _decorator; + +// /** +// * 滚轮组件类 +// */ +// @ccclass('HRoller') +// @executeInEditMode +// export class HRoller extends BaseRoller { + +// // 编辑器属性 +// @property({ tooltip: '列数' }) +// col: number = 3; + +// // 本地格式化相关 +// @property +// _format = false; +// @property({ tooltip: '本地格式化' }) +// get format(): boolean { +// return this._format; +// } +// set format(b: boolean) { +// this._format = b; +// this.resizeContentSize(); + +// if (!this.iconFactory) { +// console.error('IconFactory没有设置'); +// return; +// } + +// // 重新创建图标 +// this._content.removeAllChildren(); +// this._info.icons = []; +// this._allIcons.clear(); +// this._posToIconKey.clear(); +// // 清除位置缓存 - 添加这一行 +// this._positionCache.clear(); + +// for (let i = 0; i < this.col; i++) { +// let randomIndex = Math.floor(Math.random() * this.iconFactory.getIconNum()); +// this.createNormalIcon(i, randomIndex); +// } +// } + +// _cachedContentWidth: number = 0; +// _cachedAnchorX: number = 0; + +// /** +// * 创建滚轮实例 +// * @param id 滚轮ID +// * @param row 行数 +// * @param iconWidth 图标宽度 +// * @param iconHeight 图标高度 +// * @param iconFactory 图标工厂实例 +// * @param anchor 锚点位置 +// * @returns 新创建的滚轮实例 +// */ +// static create( +// id: number, +// col: number, +// iconWidth: number, +// iconHeight: number, +// iconFactory: IconFactory, +// anchor: Vec2 = v2(0.5, 0.5) +// ): HRoller { +// let rollerNode = new Node(`Roller${id}`); +// rollerNode.addComponent(UITransform); + +// let roller = rollerNode.addComponent(HRoller); +// roller._rollerId = id; +// roller.col = col; +// roller.iconWidth = iconWidth; +// roller.iconHeight = iconHeight; +// roller.iconFactory = iconFactory; + +// rollerNode.getComponent(UITransform).setAnchorPoint(anchor); +// roller.resizeContentSize(); +// roller.initRoller(id); +// return roller; +// } + +// /** +// * 设置节点尺寸和位置 +// */ +// setupNodesSizeAndPosition() { +// let totalWidth = this.iconWidth * this.col; +// let anchorPoint = this.node.getComponent(UITransform).anchorPoint; + +// // 设置主节点尺寸 +// this.node.getComponent(UITransform).setContentSize(totalWidth, this.iconHeight); + +// // 设置view节点 +// this._view.setPosition(0, 0); +// this._view.getComponent(UITransform).setContentSize(totalWidth, this.iconHeight); +// this._view.getComponent(UITransform).setAnchorPoint(anchorPoint); +// this._view.getComponent(UITransform).height *= 2; + +// // 设置content节点 +// this._content.setPosition(0, 0); +// this._content.getComponent(UITransform).setContentSize(totalWidth, this.iconHeight); +// this._content.getComponent(UITransform).setAnchorPoint(anchorPoint); +// this._content.removeAllChildren(); +// } + +// /** +// * 获取图标的实际坐标 +// * @param pos 图标位置索引 +// * @param height 图标高度 +// * @returns 图标的世界坐标 +// */ +// getIconPosition(pos: number, size: number = 1): Vec3 { +// // 创建缓存键 +// let cacheKey = size > 1 ? (pos + 1) * 1000 + size : pos; + +// if (this._positionCache.has(cacheKey)) { +// return this._positionCache.get(cacheKey).clone(); +// } + +// // 确保缓存数据已初始化 +// if (!this._cachedContentWidth) { +// this._cachedContentWidth = this._content.getComponent(UITransform).width; +// this._cachedAnchorX = this._content.getComponent(UITransform).anchorX; +// } + +// // 计算基准位置 +// let contentWidth = this._cachedContentWidth; +// let anchorX = this._cachedAnchorX; + +// // 计算最左边位置 +// let leftX = -contentWidth * (1 - anchorX); + +// // 计算第一个位置的中心x坐标 +// let firstCenterX = leftX + this.iconWidth / 2; + +// // 计算当前位置的中心X坐标 +// let centerX = firstCenterX + pos * this.iconWidth; + +// // 对于大图标,需要调整位置 +// let finalX = centerX; +// if (size > 1) { +// // 大图标的中心点应该下移,使其顶部对齐格子 +// // 对于高度为3的图标,中心点应该下移1个格子高度 +// finalX = centerX + (size - 1) * this.iconWidth / 2; +// } + +// // 创建最终位置 +// let position = v3(finalX, 0, 0); + +// // 缓存结果 +// this._positionCache.set(cacheKey, position.clone()); +// return position; +// } + +// /** +// * 初始化性能优化相关的缓存 +// */ +// initCache() { +// this._cachedUITransform = this._content.getComponent(UITransform); +// this._cachedContentWidth = this._cachedUITransform.width; +// this._cachedAnchorX = this._cachedUITransform.anchorX; +// } + +// /** +// * 收集现有图标 +// */ +// collectExistingIcons() { +// for (let i = 0; i < this.col; i++) { +// let icon = this._allIcons.get(this._posToIconKey.get(i)); +// if (icon) { +// this._allIcons.delete(this._posToIconKey.get(i)); +// this._posToIconKey.delete(i); +// this._info.icons.push(icon); +// } +// } +// } + +// /** +// * 手动停止滚动 +// * @param data 停止时的图标数据 +// */ +// async manualStopScroll(data: number[]) { +// if (this._info.isManualStop || +// this._info.state === ROLLER_STATE.STOP) { +// return; +// } + +// this.changeState(ROLLER_STATE.STOP); +// this._info.resetLxInfo(); +// this._stopData = data; +// this._info.isManualStop = true; +// Tween.stopAllByTarget(this._info.speedNode); + +// // 直接回收所有动态图标 +// while (this._info.icons.length > 0) { +// let icon = this._info.icons.pop(); +// this.iconFactory.recycleIcon(icon); +// } + +// // 回收固定位置图标 +// for (let i = 0; i < this.col; i++) { +// let icon = this._allIcons.get(this._posToIconKey.get(i)); +// if (icon) { +// this._allIcons.delete(this._posToIconKey.get(i)); +// this._posToIconKey.delete(i); +// this.iconFactory.recycleIcon(icon); +// } +// } +// this._allIcons.clear(); +// this._posToIconKey.clear(); + +// this.createInitIcons(data); +// // 为所有创建的图标播放动画 +// for (let icon of this._allIcons.values()) { +// icon.getComponent(Icon).playSpawnAni(); +// } +// } + +// /** +// * 创建最后一页图标 +// */ +// createLastPage() { +// let data = this._stopData; +// if (!data) return; + +// // 计算最右边icon基准位置 +// let rightX = this.getIconPosition(this.col - 1).x; +// let icons = this._info.icons; +// if (icons.length > 0) { +// rightX = Math.max(rightX, this.findHighestIconXorY(icons)); +// } + +// // 清除已有的位置映射,准备重新创建 +// this._allIcons.clear(); +// this._posToIconKey.clear(); + +// // 从左到右依次创建图标(从位置0开始) +// for (let i = 0; i < data.length; i++) { +// // 如果当前位置已被特殊图标占用,跳过 +// if (this._posToIconKey.has(i)) continue; + +// // 生成图标ID +// let pos = i; +// let iconIndex = data[i]; +// let iconKey = this.generateIconKey(pos, 1, pos); + +// // 创建图标节点 +// let icon = this.iconFactory.icfactoryCreateIcon(iconIndex); +// icon.getComponent(Icon).initIcon(iconIndex, 1, iconKey, 0, this._rollerId); + +// // 计算位置 +// let x = rightX + (pos + 1) * this.iconWidth; +// icon.setPosition(x, 0, 0); + +// this._content.addChild(icon); + +// // 存储图标节点 +// this._allIcons.set(iconKey, icon); +// this._posToIconKey.set(pos, iconKey); + +// } +// this.node.emit(ROLLER_EVENT.LAST_PAGE_CREATE, this._rollerId); +// } + + +// /** +// * 检查图标是否超出显示范围 +// */ +// checkDeadLine(icon: Node): boolean { +// if (!this._cachedContentWidth) { +// this._cachedContentWidth = this._content.getComponent(UITransform).width; +// this._cachedAnchorX = this._content.getComponent(UITransform).anchorX; +// } + +// let iconComponent = icon.getComponent(Icon); +// let lheight = iconComponent.lHeight; +// let iconBody = (lheight - 1) * this.iconWidth + this.iconWidth / 2; +// let deadLine = -(this._cachedContentWidth * this._cachedAnchorX) - iconBody; + +// return icon.position.x <= deadLine; +// } + +// /** +// * 补充新的图标 +// */ +// suppleIcon() { +// let bornLine = this.getIconPosition(this.col - 1).x; +// let icons = this._info.icons; + +// // 找到最右边的的图标X坐标 +// let rightX = this.findHighestIconXorY(icons); + +// // 如果最右边的图标低于出生线,创建新图标 +// if (rightX < bornLine) { +// this.createRandomIcon(); +// } +// } + + +// /** +// * 创建随机图标 +// */ +// createRandomIcon() { +// let iconIndex = this.getRandomIconIndex(); +// let newX = this.computeNewIconXorY(); +// let icon = this.iconFactory.icfactoryCreateIcon(iconIndex); + +// // 设置快速图标效果 +// if (this.shouldShowFastIcon()) { +// icon.getComponent(Icon).showFastIcon(true); +// } +// icon.setPosition(newX, 0, 0); +// this._content.addChild(icon); + + +// this._info.icons.push(icon); +// this.node.emit(ROLLER_EVENT.ON_R_ICON_CREATE, this._rollerId, icon); +// } + + +// /** +// * 找到最右边的图标X坐标 +// * @param icons 图标数组 +// * @returns 最右边的X坐标 +// */ +// findHighestIconXorY(icons: Node[]): number { +// return icons.reduce((maxX, icon) => { +// if (!icon || !icon.active) return maxX; + +// let iconComponent = icon.getComponent(Icon); +// if (!iconComponent) return maxX; + +// let lHeight = iconComponent.lHeight || 1; +// let iconX = icon.position.x; + +// // 对于高度大于1的图标,考虑其顶部位置 +// if (lHeight > 1) { +// // 计算图标顶部位置:当前位置 + 高度差 * 图标高度 / 2 +// return Math.max(maxX, iconX + (lHeight - 1) * this.iconWidth / 2); +// } else { +// return Math.max(maxX, iconX); +// } +// }, -999); +// } + + + +// /** +// * 计算新图标的X坐标 +// */ +// computeNewIconXorY(): number { +// let icons = this._info.icons; + +// // 如果没有图标,使用初始位置 +// if (!icons.length) { +// return this.getIconPosition(this.col - 1).x + this.iconWidth; +// } + +// // 找到最右边的图标X坐标 +// let rightX = this.findHighestIconXorY(icons); + +// // 新图标位置 = 最高图标位置 + 图标高度 +// return rightX + this.iconWidth; +// } + +// /** +// * 清理资源 +// */ +// onDestroy() { +// this._cachedUITransform = null; +// this._cachedContentWidth = 0; +// this._cachedAnchorX = 0; +// this._positionCache.clear(); +// } + +// /** +// * 滚轮移动 +// * @param dt 时间增量 +// */ +// rollerMove(dt: number) { +// // 计算移动向量 +// let speed = this._info.speed; +// let move = speed * dt; +// let moveVec = v3(move, 0, 0); + + + +// // 更新动态图标位置 +// this._info.icons.forEach(icon => { +// if (!icon || !icon.isValid) return; + +// if (icon.active) { +// let newPosition = icon.position.clone().subtract(moveVec); +// icon.setPosition(newPosition); +// } +// }); +// // 获取所有图标 +// let allIcons = Array.from(this._allIcons.values()); +// allIcons.forEach(icon => { +// if (!icon || !icon.isValid) return; +// let newPosition = icon.position.clone().subtract(moveVec); +// icon.setPosition(newPosition); +// }); + + +// } + +// /** +// * 回收滚轮图标 +// */ +// recycleRollerIcon() { +// // 回收动态图标 +// let icons = this._info.icons; +// for (let i = icons.length - 1; i >= 0; i--) { +// let icon = icons[i]; +// if (!icon || !icon.isValid) { +// icons.splice(i, 1); +// continue; +// } + +// if (this.checkDeadLine(icon)) { +// // 从数组中移除 +// icons.splice(i, 1); +// // 回收图标 +// this.iconFactory.recycleIcon(icon); +// } +// } + +// // 回收固定位置图标(非最后一页创建状态) +// if (this._info.state !== ROLLER_STATE.LAST_PAGE_CREATE) { +// for (let i = 0; i < this.col; i++) { +// let iconKey = this._posToIconKey.get(i); +// if (!iconKey) continue; + +// let icon = this._allIcons.get(iconKey); +// if (!icon || !icon.isValid) { +// this._posToIconKey.delete(i); +// this._allIcons.delete(iconKey); +// continue; +// } + +// if (this.checkDeadLine(icon)) { +// // 从映射中移除 +// this._allIcons.delete(iconKey); +// this._posToIconKey.delete(i); +// // 回收图标 +// this.iconFactory.recycleIcon(icon); +// } +// } +// } + +// // 处理特殊图标(n*1图标) +// if (this._info.state !== ROLLER_STATE.LAST_PAGE_CREATE) { +// // 获取所有特殊图标的key +// let specialIconKeys = Array.from(this._allIcons.keys()) +// .filter(key => key.startsWith('large_')); + +// for (let iconKey of specialIconKeys) { +// let icon = this._allIcons.get(iconKey); +// if (!icon || !icon.isValid) { +// this._allIcons.delete(iconKey); +// continue; +// } + +// if (this.checkDeadLine(icon)) { +// // 从映射中移除 +// this._allIcons.delete(iconKey); + +// // 移除所有关联的位置映射 +// for (let [pos, key] of this._posToIconKey.entries()) { +// if (key === iconKey) { +// this._posToIconKey.delete(pos); +// } +// } + +// // 回收图标 +// this.iconFactory.recycleIcon(icon); +// } +// } +// } +// } + + + +// /** +// * 停止处理 +// */ +// stopProcess() { +// let rightIcon = this.getIconPosition(this.col - 1); +// let stopline = rightIcon.x - 100; // 偏移量100 +// let topX = this.findHighestIconXorY(Array.from(this._allIcons.values())); + +// if (topX <= stopline) { +// this.changeState(ROLLER_STATE.BOUNCE); +// this.playBounceAnimation(); +// } +// } + +// /** +// * 播放回弹动画 +// */ +// playBounceAnimation() { +// let time = 0.1; +// let offset = 50; + +// // 获取所有图标 +// let allIcons = Array.from(this._allIcons.values()); + +// allIcons.forEach(icon => { + +// if (!icon || !icon.isValid) return; + +// let iconComponent = icon.getComponent(Icon); +// if (!iconComponent) return; + +// // 获取图标的起始位置和高度 +// let startPos = iconComponent.startPos; +// let lHeight = iconComponent.lHeight || 1; + +// // 获取图标应该在的位置 +// let position = this.getIconPosition(startPos, lHeight); + +// // 设置初始位置(向下偏移) +// // icon.setPosition(position.add(v3(-offset, 0, 0))); +// icon.setPosition(position); +// iconComponent.playSpawnAni(); + +// // 创建回弹动画 +// // tween(icon) +// // .by(time, { position: v3(offset, 0, 0) }) +// // .start(); +// }); + +// // 延迟切换到停止状态 +// this.scheduleOnce(() => { +// this.changeState(ROLLER_STATE.STOP); +// }, time); +// } + +// /** +// * 消除逻辑 +// * 一定是在静止状态消除的 +// * @param deleteMsg 删除信息 +// * */ +// deleteIconNode(positions: number[]) { +// // 记录被处理过的图标键 +// let processedPos = new Set(); + +// // 处理每个位置 +// for (let pos of positions) { +// // 如果此图标已处理过,跳过 +// if (processedPos.has(pos)) { +// continue; +// } +// let iconKey = this._posToIconKey.get(pos); +// if (!iconKey) { +// console.error('deleteIconNode iconKey is null', pos); +// continue; +// } + + + +// let iconNode = this._allIcons.get(iconKey); +// if (!iconNode || !iconNode.isValid) { +// console.error('deleteIconNode iconNode is null', pos); +// continue; +// } + +// let iconComponent = iconNode.getComponent(Icon); +// if (!iconComponent) { +// console.error('deleteIconNode iconComponent is null', pos); +// continue; +// } + + +// let startPos = iconComponent.startPos; +// // 从allIcons中删除图标 +// this._allIcons.delete(iconKey); + +// let height = iconComponent.lHeight || 1; +// // 移除所有关联的位置映射 +// if (height > 1) { +// // 对于n*1图标,需要清除所有占用的位置 +// for (let i = 0; i < height; i++) { +// this._posToIconKey.delete(startPos + i); +// // 标记此图标已处理 +// processedPos.add(startPos + i); +// } +// } else { +// this._posToIconKey.delete(pos); +// // 标记此图标已处理 +// processedPos.add(pos); + +// } +// iconComponent.playWinAni(true); +// iconComponent.playDeleteAni(); +// this.scheduleOnce(() => { +// this.iconFactory.recycleIcon(iconNode); +// }, 1.2) +// } + +// this.node.emit(ROLLER_EVENT.ICON_DELETED, this._rollerId); +// } + +// playFrameTypeChangeAni(positions: number[]): void { +// for (let pos of positions) { + +// let iconKey = this._posToIconKey.get(pos); +// if (!iconKey) continue; + +// let iconNode = this._allIcons.get(iconKey); +// if (!iconNode || !iconNode.isValid) continue; + +// let iconComponent = iconNode.getComponent(Icon); +// if (!iconComponent) continue; + +// iconComponent.playWinAni(true); +// } +// } + +// chanegeIconAndFrameType(data: any[]): void { +// return; +// } + +// /** +// * 创建新icon +// * @param createMsg 信息 +// */ +// createNewIconTop(createDatas: number[]) { +// // 获取所有图标 +// let rightX = this.getIconPosition(this.col - 1, 1).x; +// for (let i = 0; i < createDatas.length; i++) { +// let pos = this.col + i + 1; +// let iconIndex = createDatas[i]; +// let iconKey = this.generateIconKey(pos, 1, pos); +// let icon = this.iconFactory.icfactoryCreateIcon(iconIndex); +// icon.getComponent(Icon).initIcon(iconIndex, 1, iconKey, 0, this._rollerId); + +// let x = rightX + (i + 1) * this.iconWidth; +// icon.setPosition(x, 0, 0); +// this._content.addChild(icon); + +// this._allIcons.set(iconKey, icon); +// this._posToIconKey.set(pos, iconKey); +// } +// this.node.emit(ROLLER_EVENT.ICON_CREATE, this._rollerId); +// } + + +// /** icon进行掉落移动 */ +// iconFallDown(data: number[], CroSymbols: any) { +// // 更新所有icon的iconKey和posToIconKey + +// let updates = []; +// let sortNewIconStartPos = this.getNewIconsStartPos(data, CroSymbols); +// let sortIcons = this.getSortIcons(); +// for (let i = 0; i < sortNewIconStartPos.length; i++) { +// let newStartPos = sortNewIconStartPos[i]; +// let oldIcon = sortIcons[i]; +// let oldIconStartPos = oldIcon.startPos; + + +// if (oldIconStartPos === newStartPos) { +// continue; +// } +// let oldIconNode = oldIcon.icon; +// let oldIconComponent = oldIcon.component; +// let oldIconkey = oldIconComponent.iconKey; +// let lHeight = oldIconComponent.lHeight || 1; +// let newIconkey = this.generateIconKey(newStartPos, 1, newStartPos); +// let newX = this.getIconPosition(newStartPos, lHeight).x; +// let oldX = oldIconNode.position.x; + +// updates.push({ +// node: oldIconNode, +// component: oldIconComponent, +// oldKey: oldIconkey, +// oldStartPos: oldIconStartPos, +// newStartPos: newStartPos, +// newKey: newIconkey, +// height: lHeight +// }) + + +// let time = 0.3; +// tween(oldIconNode) +// .to(time, { position: v3(newX, 0, 0) }) +// .start(); +// } + +// for (let update of updates) { +// this._allIcons.delete(update.oldKey); +// for (let i = 0; i < update.height; i++) { +// this._posToIconKey.delete(update.oldStartPos + i); +// } +// } + +// // 再添加所有新映射 +// for (let update of updates) { +// // 添加新的映射 +// update.component.iconKey = update.newKey; +// this._allIcons.set(update.newKey, update.node); +// for (let i = 0; i < update.height; i++) { +// this._posToIconKey.set(update.newStartPos + i, update.newKey); +// } +// } +// this.scheduleOnce(() => { +// this.node.emit(ROLLER_EVENT.ICON_FALLEN, this._rollerId); +// }, 0.5) +// } + + +// getSortIcons() { +// let iconInfos: { icon: Node, component: Icon, startPos: number }[] = []; + +// // 收集所有图标信息 +// for (let [iconKey, iconNode] of this._allIcons.entries()) { +// if (!iconNode || !iconNode.isValid) continue; + +// let iconComponent = iconNode.getComponent(Icon); +// if (!iconComponent) continue; + +// // 记录图标信息 +// iconInfos.push({ +// icon: iconNode, +// component: iconComponent, +// startPos: iconComponent.startPos +// }); +// } + +// // 按startPos从小到大排序 +// iconInfos.sort((a, b) => a.startPos - b.startPos); + +// return iconInfos; +// } + + + +// getNewIconsStartPos(data: number[], CroSymbols: any) { +// // 存储所有图标的startPos +// let startPositions: number[] = []; + +// // 记录已处理的位置 +// let processedPositions = new Set(); +// // 记录已经处理的pos +// let processedPos = new Set(); +// // 首先处理不规则图标(n*1图标) +// if (CroSymbols) { +// for (let pos in CroSymbols) { +// let id = CroSymbols[pos].id; +// if (processedPos.has(id)) continue; +// processedPos.add(id); +// let iconSpecialMsg = CroSymbols[pos]; +// let startPos = iconSpecialMsg.startPos; +// let endPos = iconSpecialMsg.endPos; + +// // 添加不规则图标的startPos +// startPositions.push(startPos); + +// // 标记所有被占用的位置 +// for (let i = startPos; i <= endPos; i++) { +// processedPositions.add(i); +// } +// } +// } + +// // 然后处理常规图标 +// for (let i = 0; i < data.length; i++) { +// // 如果该位置未被处理(不是不规则图标的一部分) +// if (!processedPositions.has(i)) { +// startPositions.push(i); +// } +// } + +// // 从小到大排序 +// startPositions.sort((a, b) => a - b); +// return startPositions; +// } + +// } diff --git a/assets/Game/scripts/game/Icon.ts b/assets/Game/scripts/game/Icon.ts index d4aaa3c..75a5654 100644 --- a/assets/Game/scripts/game/Icon.ts +++ b/assets/Game/scripts/game/Icon.ts @@ -578,8 +578,8 @@ export class Icon extends Component { } } - this._iconChangeCallback = this.updateChangeSpriteFrame; - this.schedule(this._iconChangeCallback, 0.1); + // this._iconChangeCallback = this.updateChangeSpriteFrame; + // this.schedule(this._iconChangeCallback, 0.1); } else { // 停止动画并清理 if (this._iconChangeCallback) { diff --git a/assets/Game/scripts/game/Roller.ts b/assets/Game/scripts/game/Roller.ts index eba9249..28ab82e 100644 --- a/assets/Game/scripts/game/Roller.ts +++ b/assets/Game/scripts/game/Roller.ts @@ -763,21 +763,50 @@ export class Roller extends BaseRoller { * 创建新icon * @param createMsg 信息 */ - createNewIconTop(createDatas: number[][]) { + createNewIconTop(createDatas: number[][], CroSymbols: any) { // 获取所有图标 let topY = this.getIconPosition(0, 1); - for (let i = 0; i < createDatas.length; i++) { - let pos = i - createDatas.length; - let iconIndex = createDatas[i][0]; - let iconHeight = createDatas[i].length - let iconKey = this.generateIconKey(pos, iconHeight, pos); - let icon = this.iconFactory.icfactoryCreateIcon(iconIndex); - icon.getComponent(Icon).initIcon(iconIndex, iconHeight, iconKey, 0, this._rollerId); - let y = topY.y + (createDatas.length - i) * this.iconHeight; + //总共掉落了多少格 + let fallDownNum = 0 + //已经计算的格数 + let nowDownNum = 0 + //692029aba23ce34d091e5c51 + //[[12],[6,6,6],[12]] + //[[12],[6,6],[12]] + //[[12],[6,6,6,6]] + //[[12],[6,6],[8,8]] + for (let i = 0; i < createDatas.length; i++) { + fallDownNum += createDatas[i].length + } + + + for (let i = 0; i < createDatas.length; i++) { + let iconHeight = createDatas[i].length + let startPos = nowDownNum - fallDownNum; + let iconIndex = createDatas[i][0]; + let iconKey = this.generateIconKey(startPos, iconHeight, startPos - iconHeight + 1); + let icon = this.iconFactory.icfactoryCreateIcon(iconIndex); + + let iconFramType = 0 + if (CroSymbols) { + for (let key in CroSymbols) { + if (CroSymbols[key].PosFirst / 5 == this._rollerId) { + if (CroSymbols[key].PosFirst % 5 == i) { + iconFramType = CroSymbols[key].Type + } + } + } + + } + icon.getComponent(Icon).initIcon(iconIndex, iconHeight, iconKey, iconFramType, this._rollerId); + + let y = topY.y + (((fallDownNum - nowDownNum) - 0.5 * (iconHeight - iconHeight > 1 ? 1 : 0)) * this.iconHeight); icon.setPosition(0, y, 0); this._content.addChild(icon); this._allIcons.set(iconKey, icon); - this._posToIconKey.set(pos, iconKey); + this._posToIconKey.set(startPos, iconKey); + nowDownNum += iconHeight + } this.node.emit(ROLLER_EVENT.ICON_CREATE, this._rollerId); } diff --git a/assets/Game/scripts/game/RollerManager.ts b/assets/Game/scripts/game/RollerManager.ts index d3153b7..c4d9f42 100644 --- a/assets/Game/scripts/game/RollerManager.ts +++ b/assets/Game/scripts/game/RollerManager.ts @@ -4,7 +4,7 @@ import { Roller } from './Roller'; import { GameData, ICON_HEIGHT, ICON_WIDTH, ROLLER_COMBINE_EVENT, ROLLER_EVENT } from './Define'; import { AudioManager } from '../../../Loading/scripts/manager/AudioManager'; import { BaseRoller } from './BaseRoller'; -import { HRoller } from './HRoller'; +// import { HRoller } from './HRoller'; let { ccclass, property, executeInEditMode } = _decorator; @ccclass('RollerManager') @@ -698,7 +698,7 @@ export class RollerManager extends Component { // 9. 计算动画播放时间并处理没有删除图标的roller - let animationTime = aniData.length > 0 ? 2.4 : 1.2; + let animationTime = aniData.length > 0 ? 1.2 : 1.2; let rollersWithoutDeleteOps = []; for (let i = 0; i < this.allRollers.length; i++) { @@ -790,10 +790,10 @@ export class RollerManager extends Component { } - createNewIconTop(createDatas: number[][][]) { + createNewIconTop(createDatas: number[][][], CroSymbols: any) { this.allRollers.forEach((roller, index) => { let rollerData = createDatas[index]; - roller.createNewIconTop(rollerData); + roller.createNewIconTop(rollerData, CroSymbols); }) } diff --git a/assets/Loading/game.scene b/assets/Loading/game.scene index 1229e24..752dce0 100644 --- a/assets/Loading/game.scene +++ b/assets/Loading/game.scene @@ -187,7 +187,7 @@ "_priority": 0, "_fov": 45, "_fovAxis": 0, - "_orthoHeight": 960, + "_orthoHeight": 960.0000000000001, "_near": 0, "_far": 2000, "_color": { diff --git a/assets/Loading/scripts/comm.ts b/assets/Loading/scripts/comm.ts index e426bff..4e64b72 100644 --- a/assets/Loading/scripts/comm.ts +++ b/assets/Loading/scripts/comm.ts @@ -7,7 +7,7 @@ import { PREVIEW } from "cc/env" const gameId = "rp_11001"; // let apiaddr = "https://rpgames-api.rpfafafahkdev.com"; let apiaddr = ""; -let token = "eyJQIjoxMDA5NDksIkUiOjE3NjM5OTA4NDAsIlMiOjEwMDUsIkQiOiJycF8xMTAwMSJ9.lNl-ezMadQU_1B7s0Y5UqxjtTvzimGgYai_r_TLonyA"; +let token = "eyJQIjoxMDA5NDksIkUiOjE3NjQxNjQ1NzAsIlMiOjEwMDMsIkQiOiJycF8xMTAwMSJ9.kKSayjTf0PFYljTKNn3_xmNku2Jj4rrDyLgeK50PPo0"; let language = "en"