Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
sn09_xuanze
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
sn09_xuanze
Commits
f3e6ad3f
Commit
f3e6ad3f
authored
Oct 29, 2023
by
Tt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
移除多余节点
parent
3f440434
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
6 deletions
+19
-6
sn09_xuanze.ts
assets/sn09_xuanze/scene/sn09_xuanze.ts
+19
-6
No files found.
assets/sn09_xuanze/scene/sn09_xuanze.ts
View file @
f3e6ad3f
...
...
@@ -35,6 +35,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
pg
.
event
.
clear
();
}
async
onLoadEnd
()
{
pg
.
event
.
clear
();
// TODO 加载完成后的逻辑写在这里, 下面的代码仅供参考
this
.
initData
()
this
.
initView
()
...
...
@@ -60,7 +61,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
private
audioId
:
any
;
onTouchVoice
()
{
if
(
this
.
isEnding
)
return
;
if
(
this
.
isEnding
)
return
;
if
(
!
this
.
canTouch
)
return
;
if
(
this
.
audioId
)
{
cc
.
audioEngine
.
stopEffect
(
this
.
audioId
);
...
...
@@ -109,11 +110,12 @@ export default class SceneComponent extends MyCocosSceneComponent {
private
isEnding
:
boolean
;
gameOver
()
{
this
.
isEnding
=
true
;
this
.
clearAllChild
();
this
.
sendData
(
this
.
data
.
questions
.
length
*
3
).
then
(()
=>
{
const
middleLayer
=
cc
.
find
(
'
middleLayer
'
).
getComponent
(
'
middleLayer
'
);
middleLayer
.
saveGolds
(
this
.
data
.
questions
.
length
*
3
);
// 保存金币数量;num 是获得金币的数量,数字类型;
middleLayer
.
goNextPage
();
// 跳转到下一页
})
const
middleLayer
=
cc
.
find
(
'
middleLayer
'
).
getComponent
(
'
middleLayer
'
);
middleLayer
.
saveGolds
(
this
.
data
.
questions
.
length
*
3
);
// 保存金币数量;num 是获得金币的数量,数字类型;
middleLayer
.
goNextPage
();
// 跳转到下一页
}
private
rightList
:
Array
<
any
>
;
private
startCreate
:
boolean
;
...
...
@@ -238,9 +240,21 @@ export default class SceneComponent extends MyCocosSceneComponent {
stopFly
(
item
)
{
cc
.
Tween
.
stopAllByTarget
(
item
);
}
clearAllChild
()
{
// let layer_paopao = pg.view.find(this, 'layer_game/layer_paopao')
// let children = layer_paopao.children;
// children.forEach((node, i) => {
// if (this.rightList.some(dt => node.data.id == dt.id)) return;
// cc.Tween.stopAllByTarget(node);
// cc.tween(node).by(0.5 + (i / children.length) * 0.5, { y: -1500 }).call(() => {
// node.active = false;
// }).start();
// })
pg
.
view
.
find
(
this
,
'
layer_game/layer_paopao
'
).
removeAllChildren
();
}
// 点击泡泡
touchPaoPao
(
e
:
any
)
{
if
(
this
.
isEnding
)
return
;
if
(
this
.
isEnding
)
return
;
if
(
!
this
.
canTouch
)
return
;
this
.
canTouch
=
false
;
// 如果泡泡没有到指定位置不允许点击
...
...
@@ -274,7 +288,6 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
this
.
scheduleOnce
(()
=>
{
item
.
parent
=
null
;
this
.
canTouch
=
true
;
if
(
this
.
rightList
.
length
==
this
.
currentRightList
.
length
)
{
cc
.
Tween
.
stopAll
();
this
.
startCreate
=
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