Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cc_mz_007
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
cc_mz_007
Commits
92699e89
Commit
92699e89
authored
Sep 18, 2020
by
Li Mingzhe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: preload
parent
304acf22
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
57 additions
and
10 deletions
+57
-10
.DS_Store
.DS_Store
+0
-0
custom-hot-zone.component.ts
...c/app/common/custom-hot-zone/custom-hot-zone.component.ts
+16
-1
upload-dragon-bone.component.ts
...common/upload-dragon-bone/upload-dragon-bone.component.ts
+12
-2
scene.js
play/assets/mz_007/script/scene.js
+29
-7
No files found.
.DS_Store
View file @
92699e89
No preview for this file type
form/src/app/common/custom-hot-zone/custom-hot-zone.component.ts
View file @
92699e89
import
{
ApplicationRef
,
Component
,
ElementRef
,
EventEmitter
,
...
...
@@ -115,7 +116,7 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
constructor
(
private
nzMessageService
:
NzMessageService
)
{
constructor
(
private
nzMessageService
:
NzMessageService
,
private
appRef
:
ApplicationRef
)
{
this
.
uploadUrl
=
(
<
any
>
window
).
courseware
.
uploadUrl
();
this
.
uploadData
=
(
<
any
>
window
).
courseware
.
uploadData
();
...
...
@@ -1026,6 +1027,8 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
this
.
texPngData
=
texPngData
||
{};
this
.
animaPanelVisible
=
true
;
this
.
refresh
();
}
animaPanelCancel
()
{
...
...
@@ -1298,4 +1301,16 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
});
}
/**
* 刷新 渲染页面
*/
refresh
()
{
setTimeout
(()
=>
{
this
.
appRef
.
tick
();
},
1
);
}
}
form/src/app/common/upload-dragon-bone/upload-dragon-bone.component.ts
View file @
92699e89
import
{
Component
,
EventEmitter
,
Input
,
OnChanges
,
OnDestroy
,
Output
}
from
'
@angular/core
'
;
import
{
ApplicationRef
,
Component
,
EventEmitter
,
Input
,
OnChanges
,
OnDestroy
,
Output
}
from
'
@angular/core
'
;
import
{
NzMessageService
,
UploadXHRArgs
,
UploadFile
}
from
'
ng-zorro-antd
'
;
...
...
@@ -54,7 +54,7 @@ export class UploadDragonBoneComponent implements OnDestroy, OnChanges {
isTexJsonLoading
=
false
;
isTexPngLoading
=
false
;
constructor
(
private
nzMessageService
:
NzMessageService
)
{
constructor
(
private
appRef
:
ApplicationRef
,
private
nzMessageService
:
NzMessageService
)
{
this
.
uploadUrl
=
(
<
any
>
window
).
courseware
.
uploadUrl
();
this
.
uploadData
=
(
<
any
>
window
).
courseware
.
uploadData
();
...
...
@@ -71,6 +71,7 @@ export class UploadDragonBoneComponent implements OnDestroy, OnChanges {
setAnimaBtnClick
()
{
this
.
animaPanelVisible
=
true
;
this
.
refresh
();
}
animaPanelCancel
()
{
...
...
@@ -150,6 +151,15 @@ export class UploadDragonBoneComponent implements OnDestroy, OnChanges {
/**
* 刷新 渲染页面
*/
refresh
()
{
setTimeout
(()
=>
{
this
.
appRef
.
tick
();
},
1
);
}
ngOnDestroy
()
{
...
...
play/assets/mz_007/script/scene.js
View file @
92699e89
...
...
@@ -140,8 +140,18 @@ cc.Class({
addPreloadImage
()
{
if
(
this
.
data
.
groupArr
)
{
this
.
data
.
groupArr
.
forEach
(
group
=>
{
this
.
_imageResList
.
push
({
url
:
group
.
bg_1_url
});
this
.
_imageResList
.
push
({
url
:
group
.
bg_2_url
});
if
(
group
.
bgItem
)
{
this
.
_imageResList
.
push
({
url
:
group
.
bgItem
.
url
});
}
if
(
group
.
hotZoneItemArr
)
{
group
.
hotZoneItemArr
.
forEach
((
item
)
=>
{
if
(
item
.
pic_url
)
{
this
.
_imageResList
.
push
({
url
:
item
.
pic_url
});
}
})
}
if
(
group
.
picArr
)
{
group
.
picArr
.
forEach
(
pic
=>
{
...
...
@@ -171,11 +181,23 @@ cc.Class({
if
(
!
this
.
data
.
groupArr
)
{
return
;
}
this
.
data
.
groupArr
.
forEach
((
item
)
=>
{
if
(
item
.
skeJsonData
)
{
this
.
_animaResList
.
push
({
url
:
item
.
skeJsonData
.
url
});
this
.
_animaResList
.
push
({
url
:
item
.
texJsonData
.
url
});
this
.
_animaResList
.
push
({
url
:
item
.
texPngData
.
url
});
this
.
data
.
groupArr
.
forEach
((
group
)
=>
{
if
(
group
.
hotZoneItemArr
)
{
group
.
hotZoneItemArr
.
forEach
((
item
)
=>
{
if
(
item
.
gIdx
==
'
0
'
&
item
.
skeJsonData
)
{
this
.
_animaResList
.
push
({
url
:
item
.
skeJsonData
.
url
});
this
.
_animaResList
.
push
({
url
:
item
.
texJsonData
.
url
});
this
.
_animaResList
.
push
({
url
:
item
.
texPngData
.
url
});
}
})
}
if
(
group
.
skeJsonData
)
{
this
.
_animaResList
.
push
({
url
:
group
.
skeJsonData
.
url
});
this
.
_animaResList
.
push
({
url
:
group
.
texJsonData
.
url
});
this
.
_animaResList
.
push
({
url
:
group
.
texPngData
.
url
});
}
})
...
...
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