Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
hy07_tiankong
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
hy07_tiankong
Commits
004c7d01
Commit
004c7d01
authored
Jul 15, 2023
by
yu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
412e7ac8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
4 deletions
+19
-4
hy07_tiankong.ts
assets/hy07_tiankong/scene/hy07_tiankong.ts
+19
-4
No files found.
assets/hy07_tiankong/scene/hy07_tiankong.ts
View file @
004c7d01
...
@@ -131,7 +131,12 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -131,7 +131,12 @@ export default class SceneComponent extends MyCocosSceneComponent {
pg
.
event
.
on
(
'
layer_coin_show_coin_end
'
,
()
=>
{
pg
.
event
.
on
(
'
layer_coin_show_coin_end
'
,
()
=>
{
let
over
=
Game
.
getIns
().
addPage
();
let
over
=
Game
.
getIns
().
addPage
();
if
(
!
over
)
{
if
(
!
over
)
{
pg
.
event
.
emit
(
'
layer_ending_show
'
,
{
coin
:
this
.
coin
})
// pg.event.emit('layer_ending_show', { coin: this.coin })
const
midd
=
cc
.
find
(
'
middleLayer
'
);
if
(
!
midd
)
return
this
.
log
(
"
no middleLayer
"
);
let
middleLayer
=
midd
.
getComponent
(
'
middleLayer
'
);
middleLayer
.
saveGolds
(
this
.
coin
);
// 保存金币数量;num 是获得金币的数量,数字类型;
middleLayer
.
goNextPage
();
// 跳转到下一页
}
else
{
}
else
{
this
.
gameStart
();
this
.
gameStart
();
}
}
...
@@ -185,11 +190,13 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -185,11 +190,13 @@ export default class SceneComponent extends MyCocosSceneComponent {
let
isBig
=
data
.
wordArr
.
length
>
5
;
let
isBig
=
data
.
wordArr
.
length
>
5
;
let
count
=
data
.
count
;
let
count
=
data
.
count
;
this
.
layout_up
.
removeAllChildren
();
this
.
layout_up
.
removeAllChildren
();
this
.
layout_up
.
getComponent
(
cc
.
Layout
).
enabled
=
true
;
data
.
wordArr
.
forEach
(
async
(
dt
)
=>
{
data
.
wordArr
.
forEach
(
async
(
dt
)
=>
{
let
item
=
isBig
?
cc
.
instantiate
(
this
.
item4
)
:
cc
.
instantiate
(
this
.
item3
);
let
item
=
isBig
?
cc
.
instantiate
(
this
.
item4
)
:
cc
.
instantiate
(
this
.
item3
);
let
word
=
cc
.
find
(
"
word
"
,
item
);
let
word
=
cc
.
find
(
"
word
"
,
item
);
let
box1
=
cc
.
find
(
"
box1
"
,
item
);
let
box1
=
cc
.
find
(
"
box1
"
,
item
);
let
box
=
cc
.
find
(
"
box
"
,
item
);
// let xian = cc.find("xian", item);
// let xian = cc.find("xian", item);
word
.
getComponent
(
cc
.
Label
).
string
=
dt
.
text
.
split
(
"
"
).
join
(
""
);
word
.
getComponent
(
cc
.
Label
).
string
=
dt
.
text
.
split
(
"
"
).
join
(
""
);
item
.
active
=
true
;
item
.
active
=
true
;
...
@@ -206,6 +213,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -206,6 +213,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
word
.
getComponent
(
cc
.
Label
).
string
=
""
;
word
.
getComponent
(
cc
.
Label
).
string
=
""
;
}
else
{
}
else
{
if
(
box1
)
box1
.
active
=
true
;
if
(
box1
)
box1
.
active
=
true
;
if
(
box
)
box
.
active
=
false
;
}
}
})
})
this
.
layout_up
.
active
=
true
;
this
.
layout_up
.
active
=
true
;
...
@@ -239,9 +247,9 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -239,9 +247,9 @@ export default class SceneComponent extends MyCocosSceneComponent {
// this.layout_down.getComponent(cc.Layout).spacingX = 70;
// this.layout_down.getComponent(cc.Layout).spacingX = 70;
}
else
{
}
else
{
// this.layout_down.getComponent(cc.Layout).spacingX = -100;
// this.layout_down.getComponent(cc.Layout).spacingX = -100;
this
.
layout_up
.
getComponent
(
cc
.
Layout
).
spacingX
=
0
;
this
.
layout_up
.
getComponent
(
cc
.
Layout
).
spacingX
=
1
0
;
}
}
this
.
layout_up
.
getComponent
(
cc
.
Sprite
).
enabled
=
data
.
wordArr
.
length
>
5
;
//
this.layout_up.getComponent(cc.Sprite).enabled = data.wordArr.length > 5;
this
.
layout_down
.
getComponent
(
cc
.
Layout
).
spacingX
=
count
==
5
?
10
:
count
<
5
?
60
:
-
100
;
this
.
layout_down
.
getComponent
(
cc
.
Layout
).
spacingX
=
count
==
5
?
10
:
count
<
5
?
60
:
-
100
;
this
.
layout_down
.
children
.
forEach
((
ch
,
idx
)
=>
{
this
.
layout_down
.
children
.
forEach
((
ch
,
idx
)
=>
{
...
@@ -257,11 +265,18 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -257,11 +265,18 @@ export default class SceneComponent extends MyCocosSceneComponent {
.
start
();
.
start
();
})
})
this
.
layout_down
.
getComponent
(
cc
.
Layout
).
updateLayout
();
this
.
layout_up
.
getComponent
(
cc
.
Layout
).
updateLayout
();
this
.
layout_up
.
getComponent
(
cc
.
Layout
).
updateLayout
();
let
box_up
=
cc
.
find
(
"
box_up
"
,
this
.
layout_game
);
let
box_up
=
cc
.
find
(
"
box_up
"
,
this
.
layout_game
);
box_up
.
active
=
false
;
await
asyncDelay
(
0.03
);
box_up
.
active
=
isBig
;
this
.
isClick
=
true
;
this
.
isClick
=
true
;
if
(
isBig
&&
this
.
layout_up
.
width
<
this
.
layout_down
.
width
)
{
this
.
layout_up
.
getComponent
(
cc
.
Layout
).
enabled
=
false
;
this
.
layout_up
.
width
=
this
.
layout_down
.
width
;
}
box_up
.
width
=
this
.
layout_up
.
width
;
}
}
private
iniItem
(
item
,
text
)
{
private
iniItem
(
item
,
text
)
{
let
card
=
cc
.
find
(
"
card
"
,
item
);
let
card
=
cc
.
find
(
"
card
"
,
item
);
...
...
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