Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
anim_insert_ques
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
template admin
anim_insert_ques
Commits
21dd9102
Commit
21dd9102
authored
Apr 27, 2022
by
limingzhe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 清内存
parent
eaaaff71
Changes
38
Hide whitespace changes
Inline
Side-by-side
Showing
38 changed files
with
353 additions
and
340 deletions
+353
-340
anim_insert_ques.meta
assets/anim_insert_ques.meta
+1
-1
audios.meta
assets/anim_insert_ques/audios.meta
+1
-1
_goodjob.mp3.meta
assets/anim_insert_ques/audios/_goodjob.mp3.meta
+1
-1
go.mp3.meta
assets/anim_insert_ques/audios/go.mp3.meta
+1
-1
goodjob.mp3.meta
assets/anim_insert_ques/audios/goodjob.mp3.meta
+1
-1
ready.mp3.meta
assets/anim_insert_ques/audios/ready.mp3.meta
+1
-1
dragonBones.meta
assets/anim_insert_ques/dragonBones.meta
+1
-1
goodjob.meta
assets/anim_insert_ques/dragonBones/goodjob.meta
+1
-1
徽章动画_ske.json.meta
...s/anim_insert_ques/dragonBones/goodjob/徽章动画_ske.json.meta
+2
-1
徽章动画_tex.json.meta
...s/anim_insert_ques/dragonBones/goodjob/徽章动画_tex.json.meta
+2
-1
徽章动画_tex.png.meta
...ts/anim_insert_ques/dragonBones/goodjob/徽章动画_tex.png.meta
+3
-3
hand.meta
assets/anim_insert_ques/dragonBones/hand.meta
+1
-1
hand_ske.json.meta
assets/anim_insert_ques/dragonBones/hand/hand_ske.json.meta
+1
-1
hand_tex.json.meta
assets/anim_insert_ques/dragonBones/hand/hand_tex.json.meta
+1
-1
hand_tex.png.meta
assets/anim_insert_ques/dragonBones/hand/hand_tex.png.meta
+3
-3
fonts.meta
assets/anim_insert_ques/fonts.meta
+1
-1
BRLNSDB.TTF.meta
assets/anim_insert_ques/fonts/BRLNSDB.TTF.meta
+1
-1
Muli_1GDlj.ttf.meta
assets/anim_insert_ques/fonts/Muli_1GDlj.ttf.meta
+1
-1
scene.meta
assets/anim_insert_ques/scene.meta
+1
-1
anim_insert_ques.fire
assets/anim_insert_ques/scene/anim_insert_ques.fire
+21
-21
anim_insert_ques.fire.meta
assets/anim_insert_ques/scene/anim_insert_ques.fire.meta
+2
-2
anim_insert_ques.ts
assets/anim_insert_ques/scene/anim_insert_ques.ts
+273
-262
anim_insert_ques.ts.meta
assets/anim_insert_ques/scene/anim_insert_ques.ts.meta
+1
-1
script.meta
assets/anim_insert_ques/script.meta
+1
-1
MyCocosSceneComponent.ts.meta
assets/anim_insert_ques/script/MyCocosSceneComponent.ts.meta
+1
-1
defaultData.ts.meta
assets/anim_insert_ques/script/defaultData.ts.meta
+1
-1
runtime.js.meta
assets/anim_insert_ques/script/runtime.js.meta
+1
-1
util.ts.meta
assets/anim_insert_ques/script/util.ts.meta
+1
-1
textures.meta
assets/anim_insert_ques/textures.meta
+1
-1
back.png.meta
assets/anim_insert_ques/textures/back.png.meta
+3
-3
black.png.meta
assets/anim_insert_ques/textures/black.png.meta
+3
-3
go_0.png.meta
assets/anim_insert_ques/textures/go_0.png.meta
+3
-3
go_1.png.meta
assets/anim_insert_ques/textures/go_1.png.meta
+3
-3
go_2.png.meta
assets/anim_insert_ques/textures/go_2.png.meta
+3
-3
go_3.png.meta
assets/anim_insert_ques/textures/go_3.png.meta
+3
-3
light.png.meta
assets/anim_insert_ques/textures/light.png.meta
+3
-3
start_title.png.meta
assets/anim_insert_ques/textures/start_title.png.meta
+3
-3
builder.json
settings/builder.json
+1
-1
No files found.
assets/anim_insert_ques.meta
View file @
21dd9102
{"ver":"1.1.2","uuid":"70bc04c3-e5e3-4c70-8f48-a26ea3453ebd","isBundle":false,"bundleName":"","priority":1,"compressionType":{},"optimizeHotUpdate":{},"inlineSpriteFrames":{},"isRemoteBundle":{"ios":false,"android":false},"subMetas":{}}
\ No newline at end of file
{"ver":"1.1.2","uuid":"9885d167-7e00-428c-b5ab-c26cc063e331","isBundle":false,"bundleName":"","priority":1,"compressionType":{},"optimizeHotUpdate":{},"inlineSpriteFrames":{},"isRemoteBundle":{"ios":false,"android":false},"subMetas":{}}
\ No newline at end of file
assets/anim_insert_ques/audios.meta
View file @
21dd9102
{
"ver": "1.1.2",
"uuid": "
ffb16d4b-3e4d-411a-9451-d8cb9fd00fa0
",
"uuid": "
00c27356-4548-4344-94dc-aca3d9c85262
",
"isBundle": false,
"bundleName": "",
"priority": 1,
...
...
assets/anim_insert_ques/audios/_goodjob.mp3.meta
View file @
21dd9102
{
"ver": "2.0.1",
"uuid": "
345a2bb3-6c63-403e-9ca1-24ab794903bc
",
"uuid": "
699d9bc8-2d7d-4b47-98d1-edcb9d241ede
",
"downloadMode": 0,
"duration": 1.1755,
"subMetas": {}
...
...
assets/anim_insert_ques/audios/go.mp3.meta
View file @
21dd9102
{
"ver": "2.0.1",
"uuid": "
8216d147-d91c-4528-8781-96f07b6e54a2
",
"uuid": "
d4105d64-d01c-4e6c-984d-28fb6b4bcb07
",
"downloadMode": 0,
"duration": 5.112,
"subMetas": {}
...
...
assets/anim_insert_ques/audios/goodjob.mp3.meta
View file @
21dd9102
{
"ver": "2.0.1",
"uuid": "
971c3859-f589-46aa-83d8-aa24632c7243
",
"uuid": "
00a15000-f199-435b-9bcd-291aa5d1d432
",
"downloadMode": 0,
"duration": 4.362449,
"subMetas": {}
...
...
assets/anim_insert_ques/audios/ready.mp3.meta
View file @
21dd9102
{
"ver": "2.0.1",
"uuid": "0
5cf2f75-2b5e-4433-a428-e44d1b302731
",
"uuid": "0
2851aed-506b-4c06-a1cc-d14c11ee735c
",
"downloadMode": 0,
"duration": 2.592,
"subMetas": {}
...
...
assets/anim_insert_ques/dragonBones.meta
View file @
21dd9102
{
"ver": "1.1.2",
"uuid": "
aec7963b-8cd0-4efa-8d7d-1189d3a86ca7
",
"uuid": "
8ebb7c56-aa5b-412c-881a-05e951c528d2
",
"isBundle": false,
"bundleName": "",
"priority": 1,
...
...
assets/anim_insert_ques/dragonBones/goodjob.meta
View file @
21dd9102
{
"ver": "1.1.2",
"uuid": "
ffac39cb-d042-40fa-9232-6a6af7d106bb
",
"uuid": "
c23836af-d983-430b-b132-1edd4aeedac0
",
"isBundle": false,
"bundleName": "",
"priority": 1,
...
...
assets/anim_insert_ques/dragonBones/goodjob/徽章动画_ske.json.meta
View file @
21dd9102
{
"ver": "1.0.1",
"uuid": "
712ee0fa-2ebd-4da2-8eb8-8888b26aebe0
",
"uuid": "
ce33ffb2-0506-4d04-a61f-560a0ff93356
",
"subMetas": {}
}
\ No newline at end of file
assets/anim_insert_ques/dragonBones/goodjob/徽章动画_tex.json.meta
View file @
21dd9102
{
"ver": "1.0.1",
"uuid": "
05ddf8ee-3027-4539-b908-386e8a4793b6
",
"uuid": "
a3732e00-fdd7-44fd-95b1-47ef94d35f67
",
"subMetas": {}
}
\ No newline at end of file
assets/anim_insert_ques/dragonBones/goodjob/徽章动画_tex.png.meta
View file @
21dd9102
{
"ver": "2.3.5",
"uuid": "
ddc0cf9e-be99-4f06-80f0-9ddfeb4c688
3",
"uuid": "
46e882c6-14a7-4471-9945-985d8e6f5fb
3",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
...
...
@@ -13,8 +13,8 @@
"subMetas": {
"徽章动画_tex": {
"ver": "1.0.4",
"uuid": "
409538b5-7347-4ffb-9231-5d3e04c1ccb5
",
"rawTextureUuid": "
ddc0cf9e-be99-4f06-80f0-9ddfeb4c688
3",
"uuid": "
a646175c-c42b-4989-946a-b93fbe551bb1
",
"rawTextureUuid": "
46e882c6-14a7-4471-9945-985d8e6f5fb
3",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
...
...
assets/anim_insert_ques/dragonBones/hand.meta
View file @
21dd9102
{
"ver": "1.1.2",
"uuid": "
a288abbb-cf54-45eb-8425-3149865c1fa1
",
"uuid": "
f30cee40-2916-4116-ab24-2aa87fc4bcc4
",
"isBundle": false,
"bundleName": "",
"priority": 1,
...
...
assets/anim_insert_ques/dragonBones/hand/hand_ske.json.meta
View file @
21dd9102
{
"ver": "1.0.1",
"uuid": "
24e3c132-6f4b-471c-bbbd-ee6b2222b96f
",
"uuid": "
9b587aa6-b207-40ff-ab30-0e33f8342b78
",
"subMetas": {}
}
\ No newline at end of file
assets/anim_insert_ques/dragonBones/hand/hand_tex.json.meta
View file @
21dd9102
{
"ver": "1.0.1",
"uuid": "
b54daf60-2609-42f6-90ec-1cced6c45a0e
",
"uuid": "
802057e3-285d-4a90-a658-120020ce6bbb
",
"subMetas": {}
}
\ No newline at end of file
assets/anim_insert_ques/dragonBones/hand/hand_tex.png.meta
View file @
21dd9102
{
"ver": "2.3.5",
"uuid": "
86a6ed96-65f3-4886-87ed-7b09952baba9
",
"uuid": "
11323465-2322-43f5-a9a3-70732a8d6a3b
",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
...
...
@@ -13,8 +13,8 @@
"subMetas": {
"hand_tex": {
"ver": "1.0.4",
"uuid": "
56fad7b0-462e-4f2b-99c3-ea246095c2fb
",
"rawTextureUuid": "
86a6ed96-65f3-4886-87ed-7b09952baba9
",
"uuid": "
71811c5d-50bb-464e-a1ec-cc94c0535753
",
"rawTextureUuid": "
11323465-2322-43f5-a9a3-70732a8d6a3b
",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
...
...
assets/anim_insert_ques/fonts.meta
View file @
21dd9102
{
"ver": "1.1.2",
"uuid": "
ed983827-3ad1-4660-995b-e388237b6abd
",
"uuid": "
fe88c649-558a-426e-ad6f-af0583067035
",
"isBundle": false,
"bundleName": "",
"priority": 1,
...
...
assets/anim_insert_ques/fonts/BRLNSDB.TTF.meta
View file @
21dd9102
{
"ver": "1.1.0",
"uuid": "6
73b7859-cec2-4408-93a1-e88a18526074
",
"uuid": "6
cda5116-82bb-44cb-a57c-abb186367415
",
"subMetas": {}
}
\ No newline at end of file
assets/anim_insert_ques/fonts/Muli_1GDlj.ttf.meta
View file @
21dd9102
{
"ver": "1.1.0",
"uuid": "
860496c7-a863-46d7-8a96-cf75e852da23
",
"uuid": "
f37d95fe-8b38-4052-906e-519fc65323f2
",
"subMetas": {}
}
\ No newline at end of file
assets/anim_insert_ques/scene.meta
View file @
21dd9102
{
"ver": "1.1.2",
"uuid": "
df0821bd-02cc-43df-8749-f0a821be960e
",
"uuid": "
74c317eb-d6eb-494c-80c2-7fc602b18419
",
"isBundle": false,
"bundleName": "",
"priority": 1,
...
...
assets/anim_insert_ques/scene/anim_insert_ques.fire
View file @
21dd9102
...
...
@@ -58,7 +58,7 @@
"_groupIndex": 0,
"groupIndex": 0,
"autoReleaseAssets": false,
"_id": "
9ef4faa1-84f0-4742-95d2-d2eaf214f37d
"
"_id": "
4a29e4b1-f8b4-4b6a-b305-7d4b475e23a1
"
},
{
"__type__": "cc.Node",
...
...
@@ -320,7 +320,7 @@
"_cacheMode": 0,
"playTimes": -1,
"premultipliedAlpha": false,
"_armatureKey": "
24e3c132-6f4b-471c-bbbd-ee6b2222b96f#b54daf60-2609-42f6-90ec-1cced6c45a0e
",
"_armatureKey": "
9b587aa6-b207-40ff-ab30-0e33f8342b78#802057e3-285d-4a90-a658-120020ce6bbb
",
"_accTime": 0,
"_playCount": 0,
"_frameCache": null,
...
...
@@ -328,10 +328,10 @@
"_playing": false,
"_armatureCache": null,
"_N$dragonAsset": {
"__uuid__": "
24e3c132-6f4b-471c-bbbd-ee6b2222b96f
"
"__uuid__": "
9b587aa6-b207-40ff-ab30-0e33f8342b78
"
},
"_N$dragonAtlasAsset": {
"__uuid__": "
b54daf60-2609-42f6-90ec-1cced6c45a0e
"
"__uuid__": "
802057e3-285d-4a90-a658-120020ce6bbb
"
},
"_N$_defaultArmatureIndex": 0,
"_N$_animationIndex": 1,
...
...
@@ -422,7 +422,7 @@
"_cacheMode": 0,
"playTimes": -1,
"premultipliedAlpha": false,
"_armatureKey": "
712ee0fa-2ebd-4da2-8eb8-8888b26aebe0#05ddf8ee-3027-4539-b908-386e8a4793b6
",
"_armatureKey": "
ce33ffb2-0506-4d04-a61f-560a0ff93356#a3732e00-fdd7-44fd-95b1-47ef94d35f67
",
"_accTime": 0,
"_playCount": 0,
"_frameCache": null,
...
...
@@ -430,10 +430,10 @@
"_playing": false,
"_armatureCache": null,
"_N$dragonAsset": {
"__uuid__": "
712ee0fa-2ebd-4da2-8eb8-8888b26aebe0
"
"__uuid__": "
ce33ffb2-0506-4d04-a61f-560a0ff93356
"
},
"_N$dragonAtlasAsset": {
"__uuid__": "
05ddf8ee-3027-4539-b908-386e8a4793b6
"
"__uuid__": "
a3732e00-fdd7-44fd-95b1-47ef94d35f67
"
},
"_N$_defaultArmatureIndex": 0,
"_N$_animationIndex": 1,
...
...
@@ -655,7 +655,7 @@
"_lineHeight": 40,
"_enableWrapText": true,
"_N$file": {
"__uuid__": "6
73b7859-cec2-4408-93a1-e88a18526074
"
"__uuid__": "6
cda5116-82bb-44cb-a57c-abb186367415
"
},
"_isSystemFontUsed": false,
"_spacingX": 0,
...
...
@@ -748,7 +748,7 @@
"_lineHeight": 40,
"_enableWrapText": true,
"_N$file": {
"__uuid__": "
860496c7-a863-46d7-8a96-cf75e852da23
"
"__uuid__": "
f37d95fe-8b38-4052-906e-519fc65323f2
"
},
"_isSystemFontUsed": false,
"_spacingX": 0,
...
...
@@ -919,7 +919,7 @@
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "
21c46819-635d-44f1-8802-24eed947ec47
"
"__uuid__": "
7970e7a4-3344-4654-869e-7d86525d538f
"
},
"_type": 0,
"_sizeMode": 1,
...
...
@@ -1009,7 +1009,7 @@
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "
3c775c24-d497-4961-bef3-c07596a41a
72"
"__uuid__": "
17c172fa-3ad0-4f60-a6b7-a2e8cee687
72"
},
"_type": 0,
"_sizeMode": 1,
...
...
@@ -1099,7 +1099,7 @@
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "5
da77720-589f-4569-80d9-9b1718a36c81
"
"__uuid__": "5
b6844fd-84de-4a0b-a953-94fde6c64547
"
},
"_type": 0,
"_sizeMode": 1,
...
...
@@ -1189,7 +1189,7 @@
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "
5ed3c2b7-e11c-468f-98a4-99264a4377a4
"
"__uuid__": "
9bc3a9ad-b2e2-4811-b037-148edbc3224e
"
},
"_type": 0,
"_sizeMode": 1,
...
...
@@ -1279,7 +1279,7 @@
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "0
c4f7341-41d9-4cea-a05d-6777dddb3b86
"
"__uuid__": "0
a814c8c-7ec2-49fe-84a1-82cb2d97397c
"
},
"_type": 0,
"_sizeMode": 1,
...
...
@@ -1369,7 +1369,7 @@
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "
236c2bbd-77a1-4f2e-b4c1-7338f549a8d5
"
"__uuid__": "
c76ff575-367c-4f43-bed2-2673f9bbeb91
"
},
"_type": 0,
"_sizeMode": 1,
...
...
@@ -1459,7 +1459,7 @@
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "
9231a078-9119-4563-af21-88c1a2720b6b
"
"__uuid__": "
f9729f00-7d67-4824-808e-db4f2743b2ad
"
},
"_type": 0,
"_sizeMode": 1,
...
...
@@ -1549,7 +1549,7 @@
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "
f14ac956-031f-41f0-8fb4-4b00647c02f7
"
"__uuid__": "
7c55e90a-88f6-4947-baa2-b9a67ba52f5d
"
},
"_type": 0,
"_sizeMode": 1,
...
...
@@ -1704,7 +1704,7 @@
},
"_enabled": true,
"_clip": {
"__uuid__": "0
5cf2f75-2b5e-4433-a428-e44d1b302731
"
"__uuid__": "0
2851aed-506b-4c06-a1cc-d14c11ee735c
"
},
"_volume": 1,
"_mute": false,
...
...
@@ -1785,7 +1785,7 @@
},
"_enabled": true,
"_clip": {
"__uuid__": "
8216d147-d91c-4528-8781-96f07b6e54a2
"
"__uuid__": "
d4105d64-d01c-4e6c-984d-28fb6b4bcb07
"
},
"_volume": 1,
"_mute": false,
...
...
@@ -1866,7 +1866,7 @@
},
"_enabled": true,
"_clip": {
"__uuid__": "
971c3859-f589-46aa-83d8-aa24632c7243
"
"__uuid__": "
00a15000-f199-435b-9bcd-291aa5d1d432
"
},
"_volume": 1,
"_mute": false,
...
...
@@ -1921,7 +1921,7 @@
"_id": "29zXboiXFBKoIV4PQ2liTe"
},
{
"__type__": "
01bc5whNeBN97RckeHba7w2
",
"__type__": "
e7337yMRQxG+661GqZYnBz7
",
"_name": "",
"_objFlags": 0,
"node": {
...
...
assets/anim_insert_ques/scene/anim_insert_ques.fire.meta
View file @
21dd9102
{
"ver": "1.2.9",
"uuid": "
9ef4faa1-84f0-4742-95d2-d2eaf214f37d
",
"uuid": "
4a29e4b1-f8b4-4b6a-b305-7d4b475e23a1
",
"asyncLoadAssets": false,
"autoReleaseAssets":
fals
e,
"autoReleaseAssets":
tru
e,
"subMetas": {}
}
\ No newline at end of file
assets/anim_insert_ques/scene/anim_insert_ques.ts
View file @
21dd9102
import
{
asyncDelay
,
asyncLoadDragonBoneAnime
,
callMiddleLayerFunction
,
onHomeworkFinish
,
playAudio
}
from
"
../script/util
"
;
import
{
asyncDelay
,
callMiddleLayerFunction
,
onHomeworkFinish
,
playAudio
}
from
"
../script/util
"
;
import
{
MyCocosSceneComponent
}
from
"
../script/MyCocosSceneComponent
"
;
const
{
ccclass
,
property
}
=
cc
.
_decorator
;
...
...
@@ -13,22 +13,26 @@ export default class SceneComponent extends MyCocosSceneComponent {
addPreloadAudio
()
{
// TODO 根据自己的配置预加载音频资源
this
.
_audioResList
.
push
({
url
:
(
this
.
data
.
lrcData
&&
this
.
data
.
lrcData
.
audio_url
)
||
''
});
this
.
_audioResList
.
push
({
url
:
(
this
.
data
.
lrcData
&&
this
.
data
.
lrcData
.
audio_url
)
||
''
});
}
animBaseUrl
;
addPreloadAnima
()
{
console
.
log
(
'
this.data:
'
+
JSON
.
stringify
(
this
.
data
));
if
(
this
.
data
?.
skeJsonData
?.
url
)
{
this
.
data
.
skeJsonData
.
url
+=
'
?time=
'
+
new
Date
().
getTime
()
this
.
data
.
texJsonData
.
url
+=
'
?time=
'
+
new
Date
().
getTime
()
this
.
data
.
texPngData
.
url
+=
'
?time=
'
+
new
Date
().
getTime
()
this
.
animBaseUrl
=
this
.
data
.
skeJsonData
.
ur
;
console
.
log
(
'
this.animBaseUrl:
'
+
this
.
animBaseUrl
);
this
.
data
.
skeJsonData
.
url
+=
'
?time=
'
+
new
Date
().
getTime
()
this
.
data
.
texJsonData
.
url
+=
'
?time=
'
+
new
Date
().
getTime
()
this
.
data
.
texPngData
.
url
+=
'
?time=
'
+
new
Date
().
getTime
()
}
this
.
_animaResList
.
push
({
url
:
this
.
data
.
skeJsonData
.
url
||
''
});
this
.
_animaResList
.
push
({
url
:
this
.
data
.
texJsonData
.
url
||
''
});
this
.
_animaResList
.
push
({
url
:
this
.
data
.
texPngData
.
url
||
''
});
this
.
_animaResList
.
push
({
url
:
this
.
data
.
texJsonData
.
url
||
''
});
this
.
_animaResList
.
push
({
url
:
this
.
data
.
texPngData
.
url
||
''
});
}
onLoadEnd
()
{
...
...
@@ -43,17 +47,17 @@ export default class SceneComponent extends MyCocosSceneComponent {
let
isDataLoaded
=
false
;
let
isAnimLoaded
=
false
;
const
checkStart
=
()
=>
{
console
.
log
(
'
in checkStart:
'
,
isDataLoaded
)
console
.
log
(
'
in isAnimLoaded:
'
,
isAnimLoaded
)
console
.
log
(
'
in checkStart:
'
,
isDataLoaded
)
console
.
log
(
'
in isAnimLoaded:
'
,
isAnimLoaded
)
if
(
isDataLoaded
&&
isAnimLoaded
)
{
window
[
"
air
"
].
hideAirClassLoading
();
this
.
initView
();
}
}
}
this
.
getState
(()
=>
{
isDataLoaded
=
true
;
checkStart
();
...
...
@@ -87,12 +91,12 @@ export default class SceneComponent extends MyCocosSceneComponent {
callMiddleLayerFunction
(
'
PSQS_get_course_info
'
,
{},
(
data
)
=>
{
console
.
log
(
'
in getState 2
'
);
console
.
log
(
'
in getState 2
'
);
this
.
isFirst
=
data
.
first
;
//this.checkIsFirst();
this
.
isLast
=
data
.
last
// this.checkIsLast();
this
.
playTimes
=
data
.
playTime
// this.checkPlayTimes();
this
.
playTimes
=
data
.
playTime
// this.checkPlayTimes();
this
.
jumpData
=
data
.
saveData
// this.getJumpData();
if
(
this
.
data
.
isDebug
)
{
...
...
@@ -144,7 +148,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
return
;
}
for
(
let
i
=
0
;
i
<
lyrics
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
lyrics
.
length
;
i
++
)
{
const
data
=
lyrics
[
i
].
data
;
if
(
!
data
)
{
...
...
@@ -155,10 +159,10 @@ export default class SceneComponent extends MyCocosSceneComponent {
let
duration
=
0
;
if
(
i
!=
lyrics
.
length
-
1
)
{
duration
=
lyrics
[
i
+
1
].
time
-
lyrics
[
i
].
time
;
duration
=
lyrics
[
i
+
1
].
time
-
lyrics
[
i
].
time
;
}
this
.
textArr
.
push
({
data
,
time
,
duration
});
this
.
textArr
.
push
({
data
,
time
,
duration
});
}
}
...
...
@@ -179,7 +183,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
initView
()
{
console
.
log
(
'
in initView
'
)
console
.
log
(
'
in initView
'
)
if
(
this
.
jumpData
)
{
this
.
junpAnim
();
...
...
@@ -196,17 +200,14 @@ export default class SceneComponent extends MyCocosSceneComponent {
return
;
}
junpAnim
()
{
const
jumpFrame
=
this
.
getJumpFrame
();
this
.
dragonDisplay
.
timeScale
=
jumpFrame
;
this
.
dragonDisplay
.
armatureName
=
this
.
dragonDisplay
.
getArmatureNames
()[
0
];
const
animationName
=
this
.
dragonDisplay
.
getAnimationNames
(
this
.
dragonDisplay
.
armatureName
)[
0
];
this
.
dragonDisplay
.
playAnimation
(
animationName
,
1
);
this
.
dragonDisplay
.
playAnimation
(
this
.
animaNode
.
animationNames
[
0
],
1
);
}
getJumpFrame
()
{
...
...
@@ -219,9 +220,9 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
let
disFrame
=
maxDisFrame
;
for
(
let
i
=
1
;
i
<
arr
.
length
;
i
++
)
{
for
(
let
i
=
1
;
i
<
arr
.
length
;
i
++
)
{
const
curDis
=
(
arr
[
i
].
text
-
arr
[
i
-
1
].
text
)
/
2
;
const
curDis
=
(
arr
[
i
].
text
-
arr
[
i
-
1
].
text
)
/
2
;
if
(
disFrame
>
curDis
)
{
disFrame
=
curDis
;
}
...
...
@@ -239,7 +240,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
this
.
showStartTitleReady
();
}
}
lightBg
;
lightLeft
;
...
...
@@ -251,7 +252,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
lightBg
.
scaleY
=
this
.
canvas
.
height
/
lightBg
.
height
;
lightBg
.
opacity
=
180
;
this
.
canvas
.
addChild
(
lightBg
,
10
);
const
lightLeft
=
this
.
getSprNode
(
'
light
'
);
lightLeft
.
anchorY
=
0.9
;
...
...
@@ -263,12 +264,12 @@ export default class SceneComponent extends MyCocosSceneComponent {
lightLeft
.
rotation
=
45
;
lightLeft
.
opacity
=
0
;
cc
.
tween
(
lightLeft
)
.
to
(
1
,
{
rotation
:
-
45
},
{
easing
:
"
cubicOut
"
})
.
to
(
1
,
{
rotation
:
-
45
},
{
easing
:
"
cubicOut
"
})
.
start
();
cc
.
tween
(
lightLeft
)
.
to
(
0.5
,
{
opacity
:
255
})
.
to
(
0.5
,
{
opacity
:
255
})
.
start
();
const
lightRight
=
this
.
getSprNode
(
'
light
'
);
lightRight
.
anchorY
=
0.9
;
lightRight
.
x
=
this
.
canvas
.
width
/
2
;
...
...
@@ -279,10 +280,10 @@ export default class SceneComponent extends MyCocosSceneComponent {
lightRight
.
rotation
=
-
45
;
lightRight
.
opacity
=
0
;
cc
.
tween
(
lightRight
)
.
to
(
1
,
{
rotation
:
45
},
{
easing
:
"
cubicOut
"
})
.
to
(
1
,
{
rotation
:
45
},
{
easing
:
"
cubicOut
"
})
.
start
();
cc
.
tween
(
lightRight
)
.
to
(
0.5
,
{
opacity
:
255
})
.
to
(
0.5
,
{
opacity
:
255
})
.
start
();
...
...
@@ -309,7 +310,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
this
.
startAudioEnd
();
}));
})
.
to
(
1.5
,
{
y
:
0
},
{
easing
:
"
elasticOut
"
})
.
to
(
1.5
,
{
y
:
0
},
{
easing
:
"
elasticOut
"
})
.
start
();
this
.
title
=
title
...
...
@@ -337,13 +338,13 @@ export default class SceneComponent extends MyCocosSceneComponent {
sprNode
.
opacity
=
0
;
cc
.
tween
(
sprNode
)
.
to
(
time
/
10
,
{
opacity
:
255
})
.
to
(
time
/
10
,
{
opacity
:
255
})
.
start
();
cc
.
tween
(
sprNode
)
.
to
(
0.8
*
time
,
{
scale
:
this
.
_mapScaleMin
},
{
easing
:
'
elasticOut
'
})
.
to
(
0.8
*
time
,
{
scale
:
this
.
_mapScaleMin
},
{
easing
:
'
elasticOut
'
})
.
delay
(
0
*
time
)
.
to
(
0.2
*
time
,
{
opacity
:
0
})
.
to
(
0.2
*
time
,
{
opacity
:
0
})
.
start
();
}
...
...
@@ -376,9 +377,9 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
async
hideStartView
()
{
const
hideSpr
=
(
sprNode
,
cb
=
null
)
=>
{
const
hideSpr
=
(
sprNode
,
cb
=
null
)
=>
{
cc
.
tween
(
sprNode
)
.
to
(
0.3
,
{
opacity
:
0
})
.
to
(
0.3
,
{
opacity
:
0
})
.
call
(()
=>
{
sprNode
.
active
=
false
;
cb
&&
cb
();
...
...
@@ -401,10 +402,8 @@ export default class SceneComponent extends MyCocosSceneComponent {
startAnim
()
{
if
(
this
.
animaNode
)
{
this
.
dragonDisplay
.
armatureName
=
this
.
dragonDisplay
.
getArmatureNames
()[
0
];
const
animationName
=
this
.
dragonDisplay
.
getAnimationNames
(
this
.
dragonDisplay
.
armatureName
)[
0
];
this
.
dragonDisplay
.
playAnimation
(
animationName
,
1
);
this
.
dragonDisplay
.
playAnimation
(
this
.
animaNode
.
animationNames
[
0
]
,
1
);
this
.
dragonDisplay
.
timeScale
=
1
;
}
...
...
@@ -430,8 +429,8 @@ export default class SceneComponent extends MyCocosSceneComponent {
// this.delayDeleteAnim();
callMiddleLayerFunction
(
'
PSQS_jump_to_question
'
,
{
step
:
id
},
null
)
callMiddleLayerFunction
(
'
PSQS_jump_to_question
'
,
{
step
:
id
},
null
)
return
;
}
...
...
@@ -468,16 +467,17 @@ export default class SceneComponent extends MyCocosSceneComponent {
console
.
log
(
'
PSQS_show_rabbit 1
'
);
// callMiddleLayerFunction('PSQS_show_rabbit', null, () => {
this
.
changeToMiddleLayer
();
this
.
changeToMiddleLayer
();
console
.
log
(
'
in changeToMiddleLayer1
'
);
// this.delayDeleteAnim();
console
.
log
(
'
in changeToMiddleLayer1
'
);
// this.delayDeleteAnim();
console
.
log
(
'
PSQS_show_rabbit 2
'
)
callMiddleLayerFunction
(
'
PSQS_jump_to_question
'
,
{
step
:
id
},
null
)
hand
.
removeFromParent
();
console
.
log
(
'
PSQS_show_rabbit 2
'
)
callMiddleLayerFunction
(
'
PSQS_jump_to_question
'
,
{
step
:
id
},
null
)
// })
})
}
...
...
@@ -489,35 +489,39 @@ export default class SceneComponent extends MyCocosSceneComponent {
if
(
middleLayer
)
{
middleLayer
.
myAnimNode
=
null
;
return
;
let
dragonDisplay
=
this
.
animaNode
.
getComponent
(
dragonBones
.
ArmatureDisplay
);
const
oldAtlas
=
dragonDisplay
.
dragonAtlasAsset
;
const
oldAsset
=
dragonDisplay
.
dragonAsset
;
this
.
delayRelease
(
oldAtlas
,
oldAsset
,
this
.
animaNode
);
console
.
log
(
'
setOneAnima 101
'
)
// console.log(' setOneAnima 101')
this
.
animaNode
.
removeComponent
(
dragonBones
.
ArmatureDisplay
)
dragonDisplay
=
this
.
animaNode
.
addComponent
(
dragonBones
.
ArmatureDisplay
);
//
dragonDisplay = this.animaNode.addComponent(dragonBones.ArmatureDisplay);
const
handBase
=
cc
.
find
(
"
Canvas/hand
"
);
const
hand
=
cc
.
instantiate
(
handBase
);
hand
.
active
=
true
;
const
handDisplay
=
hand
.
getComponent
(
dragonBones
.
ArmatureDisplay
)
//
const handBase = cc.find("Canvas/hand");
//
const hand = cc.instantiate(handBase);
//
hand.active = true;
//
const handDisplay = hand.getComponent(dragonBones.ArmatureDisplay)
// const atlas = new dragonBones.DragonBonesAtlasAsset();
// const asset = new dragonBones.DragonBonesAsset();
//
//
const atlas = new dragonBones.DragonBonesAtlasAsset();
//
//
const asset = new dragonBones.DragonBonesAsset();
dragonDisplay
.
dragonAtlasAsset
=
handDisplay
.
dragonAtlasAsset
;
dragonDisplay
.
dragonAsset
=
handDisplay
.
dragonAsset
;
console
.
log
(
'
汪汪汪 21
'
)
//
dragonDisplay.dragonAtlasAsset = handDisplay.dragonAtlasAsset;
//
dragonDisplay.dragonAsset = handDisplay.dragonAsset;
//
console.log('汪汪汪 21')
oldAsset
.
decRef
();
...
...
@@ -544,7 +548,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
jumpAudio
(
id
)
{
console
.
log
(
'
in jumpAudio id:
'
,
id
);
const
stepData
=
this
.
data
.
stepArr
[
id
-
1
];
const
stepData
=
this
.
data
.
stepArr
[
id
-
1
];
console
.
log
(
'
stepData:
'
,
stepData
);
const
time
=
stepData
.
text
/
this
.
data
.
frame
;
...
...
@@ -554,13 +558,13 @@ export default class SceneComponent extends MyCocosSceneComponent {
this
.
audioId
=
audioId
;
this
.
audioClip
=
audioClip
;
});
}
continueAnim
(
id
)
{
console
.
log
(
'
in continueAnim
'
)
// this.dragonDisplay.timeScale = 1;
callMiddleLayerFunction
(
'
PSQS_hide_rabbit
'
,
null
,
()
=>
{
...
...
@@ -585,7 +589,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
this
.
continueAnim
(
id
);
this
.
jumpData
=
null
;
}
return
return
}
console
.
log
(
'
id:
'
,
id
);
...
...
@@ -607,13 +611,19 @@ export default class SceneComponent extends MyCocosSceneComponent {
const
dragonDisplay
=
goodjob
.
getComponent
(
dragonBones
.
ArmatureDisplay
);
dragonDisplay
.
playAnimation
(
'
newAnimation
'
,
1
);
playAudio
(
this
.
goodjobClip
);
playAudio
(
this
.
goodjobClip
,
()
=>
{
// this.delayDeleteAnim();
this
.
changeToMiddleLayer
();
callMiddleLayerFunction
(
'
PSQS_play_animate_over
'
,
null
,
()
=>
{})
});
// asyncDelay(2);
// this.showBack();
// dragonDisplay.on(dragonBones.EventObject.COMPLETE, (e) => {
// // this.animPlayEnd();
// })
}
...
...
@@ -625,13 +635,13 @@ export default class SceneComponent extends MyCocosSceneComponent {
back
.
scale
=
0.3
;
back
.
opacity
=
0
cc
.
tween
(
back
)
.
to
(
0.9
,
{
scale
:
this
.
_mapScaleMin
,
opacity
:
255
},
{
easing
:
'
elasticOut
'
})
.
to
(
0.9
,
{
scale
:
this
.
_mapScaleMin
,
opacity
:
255
},
{
easing
:
'
elasticOut
'
})
.
start
();
back
.
addComponent
(
cc
.
Button
);
back
.
on
(
'
click
'
,
()
=>
{
console
.
log
(
'
click back
'
)
callMiddleLayerFunction
(
'
PSQS_exit_book
'
,
null
,
()
=>
{
});
callMiddleLayerFunction
(
'
PSQS_exit_book
'
,
null
,
()
=>
{});
})
}
...
...
@@ -641,26 +651,32 @@ export default class SceneComponent extends MyCocosSceneComponent {
// callMiddleLayerFunction('PSQS_show_rabbit', null, () => {
this
.
changeToMiddleLayer
();
console
.
log
(
'
in animPlayEnd 2
'
)
this
.
changeToMiddleLayer
();
console
.
log
(
'
in animPlayEnd 2
'
)
// setTimeout(() => {
callMiddleLayerFunction
(
'
PSQS_play_animate_over
'
,
null
,
()
=>
{
})
// }, 100);
// callMiddleLayerFunction('PSQS_play_animate_over', this.animaNode, () => {})
// setTimeout(() => {
callMiddleLayerFunction
(
'
PSQS_play_animate_over
'
,
null
,
()
=>
{
})
// }, 100);
// callMiddleLayerFunction('PSQS_play_animate_over', this.animaNode, () => {})
// })
}
changeToMiddleLayer
()
{
return
;
//
return;
this
.
cleanListener
();
const
middleLayer
=
<
any
>
cc
.
find
(
"
middleLayer
"
);
if
(
middleLayer
)
{
if
(
!
this
.
animaNode
||
this
.
animaNode
.
parent
==
middleLayer
)
{
return
;
}
this
.
cleanListener
();
// middleLayer.myAnimNode.parent = middleLayer
// this.animaNode.updateScale(middleLayer);
...
...
@@ -672,180 +688,189 @@ export default class SceneComponent extends MyCocosSceneComponent {
this
.
animaNode
.
scale
=
cScale
/
mScale
*
this
.
_mapScaleMax
;
if
(
this
.
data
.
scale
)
{
this
.
animaNode
.
scale
*=
this
.
data
.
scale
;
}
}
// setTimeout(() => {
this
.
dragonDisplay
.
dragonAtlasAsset
.
addRef
();
console
.
log
(
'
in changeToMiddleLayer 2
'
);
this
.
animaNode
.
parent
=
middleLayer
;
// }, 50);
}
}
this
.
dragonDisplay
.
dragonAsset
.
addRef
();
dragonDisplay
;
animaNode
;
maxTexture
;
setOneAnima
(
data
,
cb
)
{
// setTimeout(() => {
console
.
log
(
'
setOneAnima 1
'
)
console
.
log
(
'
in changeToMiddleLayer 2
'
);
this
.
animaNode
.
parent
=
middleLayer
;
// }, 50);
}
}
// let animaNode = new cc.Node();
// let dragonDisplay = animaNode.addComponent(dragonBones.ArmatureDisplay);
async
setOneAnima1
(
data
,
cb
)
{
if
(
!
data
.
texPngData
)
{
return
}
await
asyncLoadDragonBoneAnime
(
this
.
canvas
,
data
);
const
animaNode
=
this
.
canvas
.
animaNode
;
const
middleLayer
=
<
any
>
cc
.
find
(
"
middleLayer
"
);
animaNode
.
scale
=
this
.
_mapScaleMax
;
if
(
this
.
data
.
scale
)
{
animaNode
.
scale
*=
this
.
data
.
scale
;
}
// let myAnimNode = middleLayer?.myAnimNode;
const
dragonDisplay
=
animaNode
.
getComponent
(
dragonBones
.
ArmatureDisplay
)
;
let
animaNode
=
middleLayer
?.
myAnimNode
;
dragonDisplay
.
armatureName
=
dragonDisplay
.
getArmatureNames
()[
0
];
const
animationName
=
dragonDisplay
.
getAnimationNames
(
dragonDisplay
.
armatureName
)[
0
];
dragonDisplay
.
playAnimation
(
animationName
,
1
);
dragonDisplay
.
timeScale
=
0
;
let
dragonDisplay
;
if
(
!
animaNode
)
{
dragonDisplay
.
off
(
dragonBones
.
EventObject
.
FRAME_EVENT
)
dragonDisplay
.
on
(
dragonBones
.
EventObject
.
FRAME_EVENT
,
(
event
)
=>
{
console
.
log
(
'
in frameEventFunc
'
)
console
.
log
(
'
setOneAnima 2
'
)
if
(
this
.
playTimes
>
0
)
{
this
.
animChangeStep
(
event
.
name
);
}
})
animaNode
=
new
cc
.
Node
();
dragonDisplay
=
animaNode
.
addComponent
(
dragonBones
.
ArmatureDisplay
);
dragonDisplay
.
off
(
dragonBones
.
EventObject
.
COMPLETE
)
dragonDisplay
.
on
(
dragonBones
.
EventObject
.
COMPLETE
,
()
=>
{
console
.
log
(
'
in compFunc
'
)
const
mapMaxScale
=
this
.
_mapScaleMax
;
const
data
=
this
.
data
;
animaNode
.
updateScale
=
(
oldS
,
newS
)
=>
{
if
(
this
.
isLast
&&
this
.
playTimes
>
0
)
{
this
.
showGoodjob
();
}
else
{
this
.
animPlayEnd
();
}
})
console
.
log
(
'
in updateScale 1
'
);
animaNode
.
off
(
'
touchstart
'
)
animaNode
.
on
(
'
touchstart
'
,
(
e
)
=>
{
const
pos
=
e
.
getLocation
();
const
x
=
pos
.
x
// - e.currentTarget.width / 2;
const
y
=
pos
.
y
// - e.currentTarget.height / 2;
const
cScale
=
oldS
;
const
mScale
=
newS
;
animaNode
.
scale
=
cScale
/
mScale
*
mapMaxScale
;
const
newPos
=
animaNode
.
convertToNodeSpaceAR
(
cc
.
v2
(
x
,
y
));
console
.
log
(
'
X:
'
,
Math
.
round
(
newPos
.
x
));
console
.
log
(
'
Y:
'
,
Math
.
round
(
newPos
.
y
));
});
if
(
data
.
scale
)
{
animaNode
.
scale
*=
data
.
scale
;
console
.
log
(
'
in updateScale 2
'
);
}
}
this
.
dragonDisplay
=
dragonDisplay
;
this
.
animaNode
=
animaNode
;
if
(
middleLayer
)
{
console
.
log
(
'
setOneAnima 3
'
)
middleLayer
.
myAnimNode
=
animaNode
;
}
}
else
{
console
.
log
(
'
setOneAnima 4
'
)
cb
&&
cb
();
}
dragonDisplay
;
animaNode
;
maxTexture
;
setOneAnima
(
data
,
cb
)
{
this
.
setOneAnima1
(
data
,
cb
);
return
;
dragonDisplay
=
animaNode
.
getComponent
(
dragonBones
.
ArmatureDisplay
);
console
.
log
(
'
setOneAnima 1
'
)
let
animaNode
=
new
cc
.
Node
(
);
let
dragonDisplay
=
animaNode
.
addComponent
(
dragonBones
.
ArmatureDisplay
);
console
.
log
(
'
animaNode.animBaseUr:
'
+
animaNode
.
animBaseUr
);
if
(
animaNode
.
animBaseUrl
==
this
.
animBaseUrl
)
{
// const middleLayer = <any>cc.find("middleLayer")
;
animaNode
.
parent
=
this
.
canvas
;
// let myAnimNode = middleLayer?.myAnimNode;
animaNode
.
scale
=
this
.
_mapScaleMax
;
if
(
this
.
data
.
scale
)
{
animaNode
.
scale
*=
this
.
data
.
scale
;
}
dragonDisplay
.
playAnimation
(
animaNode
[
'
animationNames
'
][
0
],
1
);
dragonDisplay
.
timeScale
=
0
;
// let animaNode ; //= middleLayer?.myAnimNode;
console
.
log
(
'
setOneAnima 13
'
)
// let dragonDisplay;
// if (!animaNode || true) {
const
frameEventFunc
=
(
e
)
=>
{
console
.
log
(
'
in frameEventFunc
'
)
// console.log(' setOneAnima 2')
if
(
this
.
playTimes
>
0
)
{
this
.
animChangeStep
(
e
[
'
name
'
]);
}
};
dragonDisplay
.
off
(
dragonBones
.
EventObject
.
FRAME_EVENT
)
dragonDisplay
.
on
(
dragonBones
.
EventObject
.
FRAME_EVENT
,
frameEventFunc
)
// animaNode = new cc.Node();
// dragonDisplay = animaNode.addComponent(dragonBones.ArmatureDisplay);
console
.
log
(
'
setOneAnima 14
'
)
// const mapMaxScale = this._mapScaleMax;
// const data = this.data;
// animaNode.updateScale = (oldS, newS) => {
// console.log('in updateScale 1');
const
compFunc
=
(
e
)
=>
{
console
.
log
(
'
in compFunc
'
)
// const cScale = oldS;
// const mScale = newS;
// animaNode.scale = cScale / mScale * mapMaxScale;
if
(
this
.
isLast
&&
this
.
playTimes
>
0
)
{
this
.
showGoodjob
();
}
else
{
this
.
animPlayEnd
();
}
}
dragonDisplay
.
off
(
dragonBones
.
EventObject
.
COMPLETE
)
dragonDisplay
.
on
(
dragonBones
.
EventObject
.
COMPLETE
,
compFunc
)
console
.
log
(
'
setOneAnima 15
'
)
// if (data.scale) {
// animaNode.scale *= data.scale;
// console.log('in updateScale 2');
// }
const
touchFunc
=
(
e
)
=>
{
// }
console
.
log
(
'
in touchFunc
'
)
// if (middleLayer) {
// console.log(' setOneAnima 3')
// middleLayer.myAnimNode = animaNode;
// }
// } else {
// console.log(' setOneAnima 4')
const
pos
=
e
.
getLocation
();
const
x
=
pos
.
x
// - e.currentTarget.width / 2;
const
y
=
pos
.
y
// - e.currentTarget.height / 2;
// dragonDisplay = animaNode.getComponent(dragonBones.ArmatureDisplay);
// }
const
newPos
=
animaNode
.
convertToNodeSpaceAR
(
cc
.
v2
(
x
,
y
));
console
.
log
(
'
X:
'
,
Math
.
round
(
newPos
.
x
));
console
.
log
(
'
Y:
'
,
Math
.
round
(
newPos
.
y
));
}
animaNode
.
off
(
'
touchstart
'
)
animaNode
.
on
(
'
touchstart
'
,
touchFunc
)
animaNode
.
parent
=
this
.
canvas
;
console
.
log
(
'
setOneAnima 16
'
)
this
.
dragonDisplay
=
dragonDisplay
;
this
.
animaNode
=
animaNode
;
if
(
!
data
.
texPngData
)
{
return
cb
&&
cb
();
return
;
}
}
console
.
log
(
'
setOneAnima 5
'
)
animaNode
.
parent
=
this
.
canvas
;
const
image
=
data
.
texPngData
.
url
;
//"http://staging-teach.cdn.ireadabc.com/5a0c5af3e952acd0ac83a6e5c6f03ff1.png";
const
ske
=
data
.
skeJsonData
.
url
;
//"http://staging-teach.cdn.ireadabc.com/bd825dcceea298d1146be8067ae3d17f.json";
const
atlas
=
data
.
texJsonData
.
url
;
//"http://staging-teach.cdn.ireadabc.com/246f8991b729fa3e5a7f4802de828efa.json";
if
(
!
data
.
texPngData
)
{
return
}
// let oldAtlas;
// let oldAsset;
console
.
log
(
'
setOneAnima 5
'
)
const
image
=
data
.
texPngData
.
url
;
//"http://staging-teach.cdn.ireadabc.com/5a0c5af3e952acd0ac83a6e5c6f03ff1.png";
const
ske
=
data
.
skeJsonData
.
url
;
//"http://staging-teach.cdn.ireadabc.com/bd825dcceea298d1146be8067ae3d17f.json";
const
atlas
=
data
.
texJsonData
.
url
;
//"http://staging-teach.cdn.ireadabc.com/246f8991b729fa3e5a7f4802de828efa.json";
let
oldAtlas
=
dragonDisplay
.
dragonAtlasAsset
let
oldAsset
=
dragonDisplay
.
dragonAsset
;
// if (myAnimNode) {
// const oldDragonDisplay = myAnimNode.getComponent(dragonBones.ArmatureDisplay)
// oldAtlas = oldDragonDisplay.dragonAtlasAsset;
// oldAsset = oldDragonDisplay.dragonAsset;
// }
cc
.
assetManager
.
loadRemote
(
image
,
(
error
,
texture
)
=>
{
console
.
log
(
'
setOneAnima 6
'
)
// cc.loader.load({url: atlas, type: 'txt'}, (error, atlasJson) => {
// cc.loader.load({url: atlas, type: 'txt'}, (error, atlasJson) => {
cc
.
assetManager
.
loadAny
({
url
:
atlas
,
reload
:
true
},
(
error
,
atlasJson
)
=>
{
console
.
log
(
'
setOneAnima 7
'
)
// cc.loader.load({url: ske, type: 'txt'}, (error, dragonBonesJson) => {
// cc.loader.load({url: ske, type: 'txt'}, (error, dragonBonesJson) => {
cc
.
assetManager
.
loadAny
({
url
:
ske
,
reload
:
true
},
(
error
,
dragonBonesJson
)
=>
{
console
.
log
(
'
setOneAnima 8
'
)
animaNode
.
animBaseUrl
=
this
.
animBaseUrl
;
// console.log(' jumpData == null ');
//
this.delayRelease(oldAtlas, oldAsset)
this
.
delayRelease
(
oldAtlas
,
oldAsset
)
// setTimeout(() => {
...
...
@@ -867,10 +892,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
// }, 2000);
// this.maxTexture = texture;
// const atlas = new dragonBones.DragonBonesAtlasAsset();
// atlas.atlasJson = atlasJson;
// atlas.texture = texture;
const
atlas
=
new
dragonBones
.
DragonBonesAtlasAsset
();
atlas
.
atlasJson
=
JSON
.
stringify
(
atlasJson
);
...
...
@@ -881,54 +903,54 @@ export default class SceneComponent extends MyCocosSceneComponent {
const
asset
=
new
dragonBones
.
DragonBonesAsset
();
asset
.
dragonBonesJson
=
JSON
.
stringify
(
dragonBonesJson
);
// console.log(' setOneAnima 10')
//
animaNode.removeComponent(dragonBones.ArmatureDisplay)
//
dragonDisplay = animaNode.addComponent(dragonBones.ArmatureDisplay);
animaNode
.
removeComponent
(
dragonBones
.
ArmatureDisplay
)
dragonDisplay
=
animaNode
.
addComponent
(
dragonBones
.
ArmatureDisplay
);
console
.
log
(
'
dragonDisplay =
'
+
typeof
(
dragonDisplay
));
dragonDisplay
.
dragonAtlasAsset
=
atlas
;
console
.
log
(
'
dragonDisplay =
'
+
typeof
(
dragonDisplay
));
dragonDisplay
.
dragonAtlasAsset
=
atlas
;
console
.
log
(
'
汪汪汪 1
'
)
dragonDisplay
.
dragonAsset
=
asset
;
dragonDisplay
.
dragonAsset
=
asset
;
console
.
log
(
'
汪汪汪 2
'
)
console
.
log
(
'
type:
'
+
typeof
(
asset
.
dragonBonesJson
));
console
.
log
(
'
type:
'
+
typeof
(
asset
.
dragonBonesJson
));
let
json
=
JSON
.
parse
(
asset
.
dragonBonesJson
);
console
.
log
(
'
json:
'
,
json
);
let
json
=
JSON
.
parse
(
asset
.
dragonBonesJson
);
console
.
log
(
'
json:
'
,
json
);
let
armatures
=
json
[
"
armature
"
];
console
.
log
(
'
armatures:
'
,
armatures
);
let
armatureNames
=
[];
for
(
let
i
=
0
;
i
<
armatures
.
length
;
i
++
)
{
armatureNames
.
push
(
armatures
[
i
].
name
);
}
console
.
log
(
'
armatureNames:
'
,
armatureNames
);
let
armatures
=
json
[
"
armature
"
];
console
.
log
(
'
armatures:
'
,
armatures
);
let
armatureNames
=
[];
for
(
let
i
=
0
;
i
<
armatures
.
length
;
i
++
)
{
armatureNames
.
push
(
armatures
[
i
].
name
);
}
console
.
log
(
'
armatureNames:
'
,
armatureNames
);
console
.
log
(
'
setOneAnima 11
'
)
if
(
armatureNames
.
length
>
0
)
{
let
defaultArmatureName
=
armatureNames
[
0
];
dragonDisplay
.
armatureName
=
defaultArmatureName
;
// let animationNames = dragonDisplay.getAnimationNames(defaultArmatureName);
let
defaultArmature
=
armatures
[
0
];
let
animations
=
defaultArmature
.
animation
;
let
animationNames
=
[];
for
(
let
i
=
0
;
i
<
animations
.
length
;
i
++
)
{
animationNames
.
push
(
animations
[
i
].
name
);
}
if
(
armatureNames
.
length
>
0
)
{
let
defaultArmatureName
=
armatureNames
[
0
];
dragonDisplay
.
armatureName
=
defaultArmatureName
;
// let animationNames = dragonDisplay.getAnimationNames(defaultArmatureName);
let
defaultArmature
=
armatures
[
0
];
let
animations
=
defaultArmature
.
animation
;
let
animationNames
=
[];
for
(
let
i
=
0
;
i
<
animations
.
length
;
i
++
)
{
animationNames
.
push
(
animations
[
i
].
name
);
}
animaNode
[
'
animationNames
'
]
=
animationNames
;
}
}
console
.
log
(
'
setOneAnima 12
'
)
animaNode
.
scale
=
this
.
_mapScaleMax
;
if
(
this
.
data
.
scale
)
{
animaNode
.
scale
*=
this
.
data
.
scale
;
}
}
// dragonDisplay.timeScale = 50;
...
...
@@ -938,7 +960,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
// animaNode.parent = middleLayer;
// // dragonDisplay.dragonAtlasAsset.decRef();
// // dragonDisplay.destroy();
...
...
@@ -948,10 +970,10 @@ export default class SceneComponent extends MyCocosSceneComponent {
// setTimeout(() => {
// callMiddleLayerFunction('PSQS_play_animate_over', null, () => {})
// }, 1000);
// }, 10000);
// return ;
...
...
@@ -984,7 +1006,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
dragonDisplay
.
off
(
dragonBones
.
EventObject
.
COMPLETE
)
dragonDisplay
.
on
(
dragonBones
.
EventObject
.
COMPLETE
,
compFunc
)
console
.
log
(
'
setOneAnima 15
'
)
const
touchFunc
=
(
e
)
=>
{
...
...
@@ -996,8 +1018,8 @@ export default class SceneComponent extends MyCocosSceneComponent {
const
y
=
pos
.
y
// - e.currentTarget.height / 2;
const
newPos
=
animaNode
.
convertToNodeSpaceAR
(
cc
.
v2
(
x
,
y
));
console
.
log
(
'
X:
'
,
Math
.
round
(
newPos
.
x
));
console
.
log
(
'
Y:
'
,
Math
.
round
(
newPos
.
y
));
console
.
log
(
'
X:
'
,
Math
.
round
(
newPos
.
x
));
console
.
log
(
'
Y:
'
,
Math
.
round
(
newPos
.
y
));
}
animaNode
.
off
(
'
touchstart
'
)
animaNode
.
on
(
'
touchstart
'
,
touchFunc
)
...
...
@@ -1010,19 +1032,19 @@ export default class SceneComponent extends MyCocosSceneComponent {
cb
&&
cb
();
// console.log("animaNode: ", animaNode);
});
});
});
});
});
});
}
}
delayRelease
(
oldAtlas
,
oldAsset
,
delteItem
=
null
)
{
delayRelease
(
oldAtlas
,
oldAsset
,
delteItem
=
null
)
{
setTimeout
(()
=>
{
if
(
oldAtlas
)
{
console
.
log
(
'
in aaaa 1
'
)
if
(
oldAtlas
.
texture
)
{
...
...
@@ -1071,7 +1093,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
getCurTextObj
()
{
const
data
=
this
.
textArr
[
this
.
textArrIndex
];
if
(
data
)
{
this
.
textArrIndex
++
;
this
.
textArrIndex
++
;
}
return
data
;
}
...
...
@@ -1099,30 +1121,30 @@ export default class SceneComponent extends MyCocosSceneComponent {
this
.
textLabel
.
curTween
.
stop
();
}
this
.
textLabel
.
node
.
opacity
=
0
;
this
.
textLabel
.
string
=
`<outline color=white width=4>
${
textObj
.
data
}
</outline>`
if
(
textObj
.
duration
)
{
if
(
textObj
.
duration
)
{
this
.
textLabel
.
curTween
=
cc
.
tween
(
this
.
textLabel
.
node
)
.
to
(
0.2
,
{
opacity
:
255
},
{
easing
:
'
sineOut
'
})
.
delay
(
textObj
.
duration
)
.
call
(()
=>
{
this
.
curTextObj
=
null
;
})
.
to
(
0.1
,
{
opacity
:
0
})
.
start
();
.
to
(
0.2
,
{
opacity
:
255
},
{
easing
:
'
sineOut
'
})
.
delay
(
textObj
.
duration
)
.
call
(()
=>
{
this
.
curTextObj
=
null
;
})
.
to
(
0.1
,
{
opacity
:
0
})
.
start
();
}
else
{
this
.
textLabel
.
curTween
=
cc
.
tween
(
this
.
textLabel
.
node
)
.
to
(
0.2
,
{
opacity
:
255
},
{
easing
:
'
sineOut
'
})
.
start
();
.
to
(
0.2
,
{
opacity
:
255
},
{
easing
:
'
sineOut
'
})
.
start
();
}
}
getTextLabel
()
{
const
richTextNode
=
new
cc
.
Node
();
richTextNode
.
y
=
-
this
.
canvas
.
height
/
2
+
20
*
this
.
_mapScaleMin
;
richTextNode
.
y
=
-
this
.
canvas
.
height
/
2
+
20
*
this
.
_mapScaleMin
;
richTextNode
.
opacity
=
0
;
richTextNode
.
anchorY
=
0
;
richTextNode
.
scale
=
this
.
_mapScaleMin
;
...
...
@@ -1154,7 +1176,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
update
(
dt
)
{
update
(
dt
)
{
this
.
checkShowText
();
}
...
...
@@ -1173,23 +1195,12 @@ export default class SceneComponent extends MyCocosSceneComponent {
// if (cc.assetManager.cacheManager) {
// cc.assetManager.cacheManager.clearCache()
// }
}
onDestroy
()
{
console
.
log
(
'
in onDestroy
'
);
this
.
changeToMiddleLayer
();
this
.
releaseAssets
();
this
.
animaNode
.
removeFromParent
();
setTimeout
(()
=>
{
if
(
this
.
dragonDisplay
)
{
this
.
dragonDisplay
.
dragonAtlasAsset
.
texture
.
destroy
();
this
.
dragonDisplay
.
dragonAtlasAsset
.
destroy
();
this
.
dragonDisplay
.
dragonAsset
.
destroy
();
}
else
{
console
.
log
(
'
没有 this.dragonDisplay
'
);
}
},
100
);
}
}
assets/anim_insert_ques/scene/anim_insert_ques.ts.meta
View file @
21dd9102
{
"ver": "1.0.8",
"uuid": "
01bc5c21-35e0-4df7-b45c-91e1db6bbc36
",
"uuid": "
e7337c8c-450c-46fb-aeb5-1aa6589c1cfb
",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
...
...
assets/anim_insert_ques/script.meta
View file @
21dd9102
{
"ver": "1.1.2",
"uuid": "
5b4367d7-2537-43d5-a7a9-fc5f5d405ad7
",
"uuid": "
401ac718-ac5b-4b4e-88c2-84e3e7f79d10
",
"isBundle": false,
"bundleName": "",
"priority": 1,
...
...
assets/anim_insert_ques/script/MyCocosSceneComponent.ts.meta
View file @
21dd9102
{
"ver": "1.0.8",
"uuid": "
d45ef1e1-912a-4371-9361-ab0290acf8af
",
"uuid": "
0396b813-deda-4e71-98eb-4f7b5a97607c
",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
...
...
assets/anim_insert_ques/script/defaultData.ts.meta
View file @
21dd9102
{
"ver": "1.0.8",
"uuid": "
c749ea77-e186-4b60-a021-1e831ba379fe
",
"uuid": "
e9c5064b-a25a-43b8-ba33-64c47c70d131
",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
...
...
assets/anim_insert_ques/script/runtime.js.meta
View file @
21dd9102
{
"ver": "1.0.8",
"uuid": "
1b178e19-5ecd-429a-8dd8-52679bc7598
4",
"uuid": "
3893e755-d172-4335-b9e0-ae6aadba329
4",
"isPlugin": true,
"loadPluginInWeb": true,
"loadPluginInNative": true,
...
...
assets/anim_insert_ques/script/util.ts.meta
View file @
21dd9102
{
"ver": "1.0.8",
"uuid": "
4cc23ada-e360-4564-b768-acb660c771c5
",
"uuid": "
38cd9b53-2899-49cc-ba1c-8a9068d1acd8
",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
...
...
assets/anim_insert_ques/textures.meta
View file @
21dd9102
{
"ver": "1.1.2",
"uuid": "
34401cf5-d596-4a35-be37-4376e7031008
",
"uuid": "
c6308b3b-beda-4402-a1e3-cc77e84e09ad
",
"isBundle": false,
"bundleName": "",
"priority": 1,
...
...
assets/anim_insert_ques/textures/back.png.meta
View file @
21dd9102
{
"ver": "2.3.5",
"uuid": "
98d57d91-eae8-4740-8a30-6c3f7ed3311e
",
"uuid": "
b455337b-0e9e-4450-ada2-792d01880695
",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
...
...
@@ -13,8 +13,8 @@
"subMetas": {
"back": {
"ver": "1.0.4",
"uuid": "
21c46819-635d-44f1-8802-24eed947ec47
",
"rawTextureUuid": "
98d57d91-eae8-4740-8a30-6c3f7ed3311e
",
"uuid": "
7970e7a4-3344-4654-869e-7d86525d538f
",
"rawTextureUuid": "
b455337b-0e9e-4450-ada2-792d01880695
",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
...
...
assets/anim_insert_ques/textures/black.png.meta
View file @
21dd9102
{
"ver": "2.3.5",
"uuid": "
601273b3-10f8-4a15-800a-2b9417d13e35
",
"uuid": "
9567fd25-2231-4c00-b3c9-d015ceed71f2
",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
...
...
@@ -13,8 +13,8 @@
"subMetas": {
"black": {
"ver": "1.0.4",
"uuid": "5
da77720-589f-4569-80d9-9b1718a36c81
",
"rawTextureUuid": "
601273b3-10f8-4a15-800a-2b9417d13e35
",
"uuid": "5
b6844fd-84de-4a0b-a953-94fde6c64547
",
"rawTextureUuid": "
9567fd25-2231-4c00-b3c9-d015ceed71f2
",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
...
...
assets/anim_insert_ques/textures/go_0.png.meta
View file @
21dd9102
{
"ver": "2.3.5",
"uuid": "
1927e1c3-9502-4e94-ad9c-cbe7c6fec162
",
"uuid": "
3ff6bf5a-5ddf-44d8-9e4a-2d8eed711245
",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
...
...
@@ -13,8 +13,8 @@
"subMetas": {
"go_0": {
"ver": "1.0.4",
"uuid": "
f14ac956-031f-41f0-8fb4-4b00647c02f7
",
"rawTextureUuid": "
1927e1c3-9502-4e94-ad9c-cbe7c6fec162
",
"uuid": "
7c55e90a-88f6-4947-baa2-b9a67ba52f5d
",
"rawTextureUuid": "
3ff6bf5a-5ddf-44d8-9e4a-2d8eed711245
",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
...
...
assets/anim_insert_ques/textures/go_1.png.meta
View file @
21dd9102
{
"ver": "2.3.5",
"uuid": "
bee5d541-20f4-4fa6-8c3d-b5f1df589d38
",
"uuid": "
541c12f0-7a8c-4565-b00d-6a475d510006
",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
...
...
@@ -13,8 +13,8 @@
"subMetas": {
"go_1": {
"ver": "1.0.4",
"uuid": "0
c4f7341-41d9-4cea-a05d-6777dddb3b86
",
"rawTextureUuid": "
bee5d541-20f4-4fa6-8c3d-b5f1df589d38
",
"uuid": "0
a814c8c-7ec2-49fe-84a1-82cb2d97397c
",
"rawTextureUuid": "
541c12f0-7a8c-4565-b00d-6a475d510006
",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
...
...
assets/anim_insert_ques/textures/go_2.png.meta
View file @
21dd9102
{
"ver": "2.3.5",
"uuid": "
d3bfcc1a-4426-45f4-b88d-2cb22eb55888
",
"uuid": "
19adb859-2213-4922-bc8f-c5301ec05684
",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
...
...
@@ -13,8 +13,8 @@
"subMetas": {
"go_2": {
"ver": "1.0.4",
"uuid": "
236c2bbd-77a1-4f2e-b4c1-7338f549a8d5
",
"rawTextureUuid": "
d3bfcc1a-4426-45f4-b88d-2cb22eb55888
",
"uuid": "
c76ff575-367c-4f43-bed2-2673f9bbeb91
",
"rawTextureUuid": "
19adb859-2213-4922-bc8f-c5301ec05684
",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
...
...
assets/anim_insert_ques/textures/go_3.png.meta
View file @
21dd9102
{
"ver": "2.3.5",
"uuid": "
77f031b8-d8b6-4894-9dc5-94990c2269b3
",
"uuid": "
4d4ee228-6710-482c-8b37-27d3fd579047
",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
...
...
@@ -13,8 +13,8 @@
"subMetas": {
"go_3": {
"ver": "1.0.4",
"uuid": "
9231a078-9119-4563-af21-88c1a2720b6b
",
"rawTextureUuid": "
77f031b8-d8b6-4894-9dc5-94990c2269b3
",
"uuid": "
f9729f00-7d67-4824-808e-db4f2743b2ad
",
"rawTextureUuid": "
4d4ee228-6710-482c-8b37-27d3fd579047
",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
...
...
assets/anim_insert_ques/textures/light.png.meta
View file @
21dd9102
{
"ver": "2.3.5",
"uuid": "
aec153f2-a8d7-440c-a716-e1832c82cfdd
",
"uuid": "
c084885e-3a84-4a14-a24e-267fb24aef7e
",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
...
...
@@ -13,8 +13,8 @@
"subMetas": {
"light": {
"ver": "1.0.4",
"uuid": "
3c775c24-d497-4961-bef3-c07596a41a
72",
"rawTextureUuid": "
aec153f2-a8d7-440c-a716-e1832c82cfdd
",
"uuid": "
17c172fa-3ad0-4f60-a6b7-a2e8cee687
72",
"rawTextureUuid": "
c084885e-3a84-4a14-a24e-267fb24aef7e
",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
...
...
assets/anim_insert_ques/textures/start_title.png.meta
View file @
21dd9102
{
"ver": "2.3.5",
"uuid": "
5e58a84c-2d04-4d5f-bf57-e1e735a1f75b
",
"uuid": "
2a320afe-8db9-4e15-8811-f914c95b4758
",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
...
...
@@ -13,8 +13,8 @@
"subMetas": {
"start_title": {
"ver": "1.0.4",
"uuid": "
5ed3c2b7-e11c-468f-98a4-99264a4377a4
",
"rawTextureUuid": "
5e58a84c-2d04-4d5f-bf57-e1e735a1f75b
",
"uuid": "
9bc3a9ad-b2e2-4811-b037-148edbc3224e
",
"rawTextureUuid": "
2a320afe-8db9-4e15-8811-f914c95b4758
",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
...
...
settings/builder.json
View file @
21dd9102
{
"title"
:
"play"
,
"packageName"
:
"org.cocos2d.demo"
,
"startScene"
:
"
9ef4faa1-84f0-4742-95d2-d2eaf214f37d
"
,
"startScene"
:
"
4a29e4b1-f8b4-4b6a-b305-7d4b475e23a1
"
,
"excludeScenes"
:
[],
"includeSDKBox"
:
false
,
"orientation"
:
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment