Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
NJ_YueDuJiaYouZhan
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
NJ_YueDuJiaYouZhan
Commits
deb21346
Commit
deb21346
authored
Jun 22, 2022
by
liujiangnan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 未创建的页面处理
parent
0c730d0d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
12 deletions
+20
-12
NJ_YueDuJiaYouZhan.ts
assets/NJ_YueDuJiaYouZhan/scene/NJ_YueDuJiaYouZhan.ts
+20
-12
No files found.
assets/NJ_YueDuJiaYouZhan/scene/NJ_YueDuJiaYouZhan.ts
View file @
deb21346
...
...
@@ -40,6 +40,8 @@ export default class SceneComponent extends MyCocosSceneComponent {
if
(
this
.
currentIndex
!==
0
)
{
cc
.
find
(
`Canvas/bg/L1`
).
x
=
-
4000
;
}
cc
.
find
(
`Canvas/bg/right`
).
active
=
this
.
currentIndex
<
4
;
cc
.
find
(
`Canvas/bg/left`
).
active
=
this
.
currentIndex
>
0
;
const
middleLayer
=
cc
.
find
(
'
middleLayer
'
);
if
(
!
middleLayer
)
{
...
...
@@ -69,18 +71,23 @@ export default class SceneComponent extends MyCocosSceneComponent {
});
const
ballData
=
JSON
.
parse
(
classDataStr
).
rows
;
ballData
.
forEach
((
data
,
idx
)
=>
{
if
(
idx
>=
5
)
{
console
.
warn
(
'
idx >= 5
'
);
return
;
}
for
(
let
_index
=
0
;
_index
<
5
;
_index
++
)
{
const
data
=
ballData
[
_index
];
const
idx
=
_index
;
const
level
=
cc
.
find
(
`Canvas/bg/L
${
idx
+
1
}
`
);
data
.
children
.
forEach
((
book
,
i
)
=>
{
if
(
i
>=
3
)
{
console
.
warn
(
'
book >= 3
'
);
return
;
if
(
!
data
)
{
cc
.
find
(
`book
${
1
}
`
,
level
).
active
=
false
;
cc
.
find
(
`book
${
2
}
`
,
level
).
active
=
false
;
cc
.
find
(
`book
${
3
}
`
,
level
).
active
=
false
;
continue
;
}
for
(
let
j
=
0
;
j
<
3
;
j
++
)
{
const
book
=
data
.
children
[
j
];
if
(
!
book
)
{
cc
.
find
(
`book
${
j
+
1
}
`
,
level
).
active
=
false
;
continue
;
}
const
bookNode
=
cc
.
find
(
`book
${
i
+
1
}
`
,
level
);
const
bookNode
=
cc
.
find
(
`book
${
j
+
1
}
`
,
level
);
bookNode
.
attr
({
syllabus_id
:
book
.
id
,
pid
:
book
.
pid
});
buttonOnClick
(
bookNode
,
async
()
=>
{
...
...
@@ -107,8 +114,9 @@ export default class SceneComponent extends MyCocosSceneComponent {
jumpToCourseWare
(
row
.
id
);
}
});
});
});
}
}
// 播放背景音乐
cc
.
audioEngine
.
stopMusic
();
...
...
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