Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
ngt_video
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
ngt_video
Commits
2a172259
Commit
2a172259
authored
Oct 17, 2022
by
liujiangnan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 骨骼动画
parent
27127895
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
8 deletions
+7
-8
util.js
assets/ngt_video/Script/util.js
+7
-8
No files found.
assets/ngt_video/Script/util.js
View file @
2a172259
...
@@ -253,7 +253,7 @@ export async function asyncLoadDragonBoneAnime(node, { skeJsonData: { url: skeJs
...
@@ -253,7 +253,7 @@ export async function asyncLoadDragonBoneAnime(node, { skeJsonData: { url: skeJs
});
});
const
loadTexJsonData
=
new
Promise
((
resolve
,
reject
)
=>
{
const
loadTexJsonData
=
new
Promise
((
resolve
,
reject
)
=>
{
cc
.
assetManager
.
load
Any
({
url
:
texJsonDataUrl
}
,
(
error
,
atlasJson
)
=>
{
cc
.
assetManager
.
load
Remote
(
texJsonDataUrl
,
(
error
,
atlasJson
)
=>
{
if
(
error
)
{
if
(
error
)
{
reject
(
error
);
reject
(
error
);
}
}
...
@@ -262,7 +262,7 @@ export async function asyncLoadDragonBoneAnime(node, { skeJsonData: { url: skeJs
...
@@ -262,7 +262,7 @@ export async function asyncLoadDragonBoneAnime(node, { skeJsonData: { url: skeJs
});
});
const
loadSkeJsonData
=
new
Promise
((
resolve
,
reject
)
=>
{
const
loadSkeJsonData
=
new
Promise
((
resolve
,
reject
)
=>
{
cc
.
assetManager
.
load
Any
({
url
:
skeJsonDataUrl
}
,
(
error
,
dragonBonesJson
)
=>
{
cc
.
assetManager
.
load
Remote
(
skeJsonDataUrl
,
(
error
,
dragonBonesJson
)
=>
{
if
(
error
)
{
if
(
error
)
{
reject
(
error
);
reject
(
error
);
}
}
...
@@ -272,20 +272,19 @@ export async function asyncLoadDragonBoneAnime(node, { skeJsonData: { url: skeJs
...
@@ -272,20 +272,19 @@ export async function asyncLoadDragonBoneAnime(node, { skeJsonData: { url: skeJs
Promise
.
all
([
loadTexture
,
loadTexJsonData
,
loadSkeJsonData
]).
then
(([
texture
,
atlasJson
,
dragonBonesJson
])
=>
{
Promise
.
all
([
loadTexture
,
loadTexJsonData
,
loadSkeJsonData
]).
then
(([
texture
,
atlasJson
,
dragonBonesJson
])
=>
{
const
atlas
=
new
dragonBones
.
DragonBonesAtlasAsset
();
const
atlas
=
new
dragonBones
.
DragonBonesAtlasAsset
();
atlas
.
atlasJson
=
JSON
.
stringify
(
atlasJson
);
atlas
.
atlasJson
=
JSON
.
stringify
(
atlasJson
.
json
);
atlas
.
texture
=
texture
;
atlas
.
texture
=
texture
;
const
asset
=
new
dragonBones
.
DragonBonesAsset
();
const
asset
=
new
dragonBones
.
DragonBonesAsset
();
asset
.
dragonBonesJson
=
JSON
.
stringify
(
dragonBonesJson
);
asset
.
dragonBonesJson
=
JSON
.
stringify
(
dragonBonesJson
.
json
);
dragonDisplay
.
dragonAtlasAsset
=
atlas
;
dragonDisplay
.
dragonAtlasAsset
=
atlas
;
dragonDisplay
.
dragonAsset
=
asset
;
dragonDisplay
.
dragonAsset
=
asset
;
let
armatureNames
=
(
dragonBonesJson
).
armature
.
map
(
data
=>
data
.
name
);
//设置
let
defaultArmature
=
dragonBonesJson
.
json
.
armature
[
0
];
//aramture 所有的骨骼名称
dragonDisplay
.
armatureName
=
defaultArmature
.
name
;
if
(
armatureNames
.
length
>
0
)
{
dragonDisplay
.
armatureName
=
armatureNames
[
0
];
}
resolve
(
animaNode
);
resolve
(
animaNode
);
});
});
});
});
...
...
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