Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OP05
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
OP05
Commits
236d0c5d
Commit
236d0c5d
authored
Sep 23, 2021
by
Tt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
动画加载完成
parent
6aa3f9b9
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
53 additions
and
18 deletions
+53
-18
gameManager.js
play/assets/scene/scene/gameManager.js
+2
-2
pg.js
play/assets/scene/scene/pg.js
+35
-0
scene.fire
play/assets/scene/scene/scene.fire
+11
-15
scene.js
play/assets/scene/scene/scene.js
+5
-1
No files found.
play/assets/scene/scene/gameManager.js
View file @
236d0c5d
...
@@ -27,8 +27,8 @@ class GameManager {
...
@@ -27,8 +27,8 @@ class GameManager {
obj
.
sound
=
ar
.
wordAudio
;
obj
.
sound
=
ar
.
wordAudio
;
obj
.
img
=
ar
.
bgImg
;
obj
.
img
=
ar
.
bgImg
;
obj
.
cartoonSke
=
ar
.
imgAni
.
ske
.
url
;
obj
.
cartoonSke
=
ar
.
imgAni
.
ske
.
url
;
obj
.
cartoonTex
=
ar
.
imgAni
.
ske
.
url
;
obj
.
cartoonTex
=
ar
.
imgAni
.
tex
.
url
;
obj
.
cartoonPng
=
ar
.
imgAni
.
ske
.
url
;
obj
.
cartoonPng
=
ar
.
imgAni
.
png
.
url
;
this
.
_list
.
push
(
obj
);
this
.
_list
.
push
(
obj
);
}
}
console
.
log
(
this
.
_list
);
//原始数据转为数组
console
.
log
(
this
.
_list
);
//原始数据转为数组
...
...
play/assets/scene/scene/pg.js
View file @
236d0c5d
...
@@ -247,6 +247,33 @@ pg.view = {
...
@@ -247,6 +247,33 @@ pg.view = {
},
},
cloneNode
(
node
)
{
cloneNode
(
node
)
{
return
cc
.
instantiate
(
node
);
return
cc
.
instantiate
(
node
);
},
loadDB
(
item
,
config
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
pg
.
load
.
loadNetRes
(
config
.
png
).
then
((
png
)
=>
{
pg
.
load
.
loadNetRes
(
config
.
ske
).
then
((
ske
)
=>
{
pg
.
load
.
loadNetRes
(
config
.
tex
).
then
((
tex
)
=>
{
var
atlas
=
new
dragonBones
.
DragonBonesAtlasAsset
();
atlas
.
atlasJson
=
JSON
.
stringify
(
tex
.
json
);
atlas
.
texture
=
png
;
var
asset
=
new
dragonBones
.
DragonBonesAsset
();
asset
.
dragonBonesJson
=
JSON
.
stringify
(
ske
.
json
);
let
dragonDisplay
=
item
.
getComponent
(
dragonBones
.
ArmatureDisplay
);
dragonDisplay
.
dragonAtlasAsset
=
atlas
;
dragonDisplay
.
dragonAsset
=
asset
;
//设置
let
defaultArmature
=
ske
.
json
.
armature
[
0
];
//aramture 所有的骨骼名称
dragonDisplay
.
armatureName
=
defaultArmature
.
name
;
resolve
(
defaultArmature
.
animation
[
0
].
name
);
})
})
})
});
}
}
}
}
//加载 未封装bundle
//加载 未封装bundle
...
@@ -260,6 +287,14 @@ pg.load = {
...
@@ -260,6 +287,14 @@ pg.load = {
});
});
})
})
},
},
loadNetRes
:
function
(
url
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
cc
.
assetManager
.
loadRemote
(
url
,
(
err
,
info
)
=>
{
if
(
err
&&
!
data
)
return
resolve
(
pg
.
logger
.
w
(
'
loading loadRes warn->
'
,
res
));
resolve
(
info
);
});
})
},
loadImg
:
function
()
{
loadImg
:
function
()
{
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
this
.
loadRes
(
url
,
cc
.
SpriteFrame
).
then
((
data
)
=>
{
this
.
loadRes
(
url
,
cc
.
SpriteFrame
).
then
((
data
)
=>
{
...
...
play/assets/scene/scene/scene.fire
View file @
236d0c5d
...
@@ -807,13 +807,13 @@
...
@@ -807,13 +807,13 @@
},
},
{
{
"__type__": "cc.Node",
"__type__": "cc.Node",
"_name": "
apple_ske
",
"_name": "
carton
",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 2
"__id__": 2
},
},
"_children": [],
"_children": [],
"_active":
fals
e,
"_active":
tru
e,
"_components": [
"_components": [
{
{
"__id__": 16
"__id__": 16
...
@@ -830,8 +830,8 @@
...
@@ -830,8 +830,8 @@
},
},
"_contentSize": {
"_contentSize": {
"__type__": "cc.Size",
"__type__": "cc.Size",
"width":
773
,
"width":
362.6105263157899
,
"height":
1000.0000000000008
"height":
483.5647539622176
},
},
"_anchorPoint": {
"_anchorPoint": {
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
...
@@ -880,32 +880,28 @@
...
@@ -880,32 +880,28 @@
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
}
],
],
"_armatureName": "
Armature
",
"_armatureName": "",
"_animationName": "
apple
",
"_animationName": "",
"_preCacheMode": 0,
"_preCacheMode": 0,
"_cacheMode": 0,
"_cacheMode": 0,
"playTimes": -1,
"playTimes": -1,
"premultipliedAlpha": false,
"premultipliedAlpha": false,
"_armatureKey": "0
c3549c9-9951-47a1-9c7d-c1eeb12ceff2#bd58c477-0554-44be-8fde-701542d0ce66
",
"_armatureKey": "0
ec7ccd1-a7be-4ed4-8964-d9f90fb9c1c9#348d2f21-e4da-4ff3-b20c-c769e12aa82c
",
"_accTime": 0,
"_accTime": 0,
"_playCount": 0,
"_playCount": 0,
"_frameCache": null,
"_frameCache": null,
"_curFrame": null,
"_curFrame": null,
"_playing": false,
"_playing": false,
"_armatureCache": null,
"_armatureCache": null,
"_N$dragonAsset": {
"_N$dragonAsset": null,
"__uuid__": "0c3549c9-9951-47a1-9c7d-c1eeb12ceff2"
"_N$dragonAtlasAsset": null,
},
"_N$dragonAtlasAsset": {
"__uuid__": "bd58c477-0554-44be-8fde-701542d0ce66"
},
"_N$_defaultArmatureIndex": 0,
"_N$_defaultArmatureIndex": 0,
"_N$_animationIndex":
1
,
"_N$_animationIndex":
0
,
"_N$_defaultCacheMode": 0,
"_N$_defaultCacheMode": 0,
"_N$timeScale": 1,
"_N$timeScale": 1,
"_N$debugBones": false,
"_N$debugBones": false,
"_N$enableBatch": false,
"_N$enableBatch": false,
"_id": "
f7NZhjd8BPd6HSzCaPOI6X
"
"_id": "
57SOuId/NBbpwfQXVa7l9o
"
},
},
{
{
"__type__": "cc.Node",
"__type__": "cc.Node",
...
...
play/assets/scene/scene/scene.js
View file @
236d0c5d
...
@@ -182,6 +182,7 @@ cc.Class({
...
@@ -182,6 +182,7 @@ cc.Class({
let
progress
=
pg
.
view
.
find
(
this
,
"
progress
"
)
let
progress
=
pg
.
view
.
find
(
this
,
"
progress
"
)
let
end
=
pg
.
view
.
find
(
this
,
"
end
"
);
let
end
=
pg
.
view
.
find
(
this
,
"
end
"
);
let
end_success
=
pg
.
view
.
find
(
end
,
"
bg_success
"
)
let
end_success
=
pg
.
view
.
find
(
end
,
"
bg_success
"
)
let
carton
=
pg
.
view
.
find
(
this
,
"
carton
"
)
let
bg_book
=
pg
.
view
.
find
(
this
,
"
bg_book
"
);
let
bg_book
=
pg
.
view
.
find
(
this
,
"
bg_book
"
);
let
icon_ex
=
pg
.
view
.
find
(
this
,
"
icon_ex
"
);
let
icon_ex
=
pg
.
view
.
find
(
this
,
"
icon_ex
"
);
let
btn_next
=
pg
.
view
.
find
(
this
,
"
btn_next
"
);
let
btn_next
=
pg
.
view
.
find
(
this
,
"
btn_next
"
);
...
@@ -190,7 +191,10 @@ cc.Class({
...
@@ -190,7 +191,10 @@ cc.Class({
if
(
GameManager
.
getIns
().
getState
()
==
0
)
{
if
(
GameManager
.
getIns
().
getState
()
==
0
)
{
//拓展加载动画的内容
//拓展加载动画的内容
pg
.
view
.
loadDB
(
carton
,
{
ske
:
this
.
_stageData
.
cartoonSke
,
tex
:
this
.
_stageData
.
cartoonTex
,
png
:
this
.
_stageData
.
cartoonPng
}).
then
((
animationName
)
=>
{
let
dragonDisplay
=
carton
.
getComponent
(
dragonBones
.
ArmatureDisplay
);
dragonDisplay
.
playAnimation
(
animationName
,
1
);
//animation所有的动画名称
})
//拓展文字显示的动画
//拓展文字显示的动画
pg
.
view
.
visible
(
end
,
false
);
//不显示的内容用false
pg
.
view
.
visible
(
end
,
false
);
//不显示的内容用false
...
...
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