Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
ns_video_map
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
ns_video_map
Commits
582324f8
Commit
582324f8
authored
May 07, 2022
by
limingzhe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 删除错误资源加载
parent
502f448c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
4 deletions
+5
-4
ns_video_map.ts
assets/ns_video_map/scene/ns_video_map.ts
+3
-4
MyCocosSceneComponent.ts
assets/ns_video_map/script/MyCocosSceneComponent.ts
+2
-0
No files found.
assets/ns_video_map/scene/ns_video_map.ts
View file @
582324f8
...
...
@@ -9,8 +9,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
addPreloadImage
()
{
// TODO 根据自己的配置预加载图片资源
this
.
_imageResList
.
push
({
url
:
this
.
data
.
pic_url
});
this
.
_imageResList
.
push
({
url
:
this
.
data
.
pic_url_2
});
}
addPreloadAudio
()
{
...
...
@@ -105,10 +104,10 @@ export default class SceneComponent extends MyCocosSceneComponent {
// 在main.js 加入以下代码:
// cc.macro.ENABLE_TRANSPARENT_CANVAS = true; //加在 cc.game.run(); 前面
// cc.director.setClearColor(new cc.Color(0,0,0, 0)); //加在cc.game.run(function); 回调里面
cc
.
Camera
.
main
.
backgroundColor
=
new
cc
.
Color
(
0
,
0
,
0
,
0
);
//
cc.Camera.main.backgroundColor = new cc.Color(0,0,0, 0);
// cc.game.canvas.style.backgroundColor = 'rgba(0, 0, 0, 0)'
cc
.
game
.
canvas
.
style
.
backgroundColor
=
'
transparent
'
;
//
cc.game.canvas.style.backgroundColor = 'transparent';
}
...
...
assets/ns_video_map/script/MyCocosSceneComponent.ts
View file @
582324f8
...
...
@@ -87,8 +87,10 @@ export class MyCocosSceneComponent extends cc.Component {
preload
()
{
const
preloadArr
=
this
.
_imageResList
.
concat
(
this
.
_audioResList
).
concat
(
this
.
_animaResList
);
console
.
log
(
'
preloadArr:
'
,
preloadArr
);
cc
.
assetManager
.
loadAny
(
preloadArr
,
null
,
null
,
(
err
,
data
)
=>
{
console
.
log
(
'
err:
'
,
err
);
if
(
window
&&
window
[
"
air
"
])
{
// window["air"].onCourseInScreen = (next) => {
// window["air"].isCourseInScreen = true;
...
...
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