Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
hy17_hds
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
hy17_hds
Commits
087be0a1
Commit
087be0a1
authored
Sep 07, 2023
by
Tt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
游戏内部的数据传输
parent
cdc4ae86
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
4 deletions
+31
-4
hy17_hds.ts
assets/hy17_hds/scene/hy17_hds.ts
+20
-3
pg_hy17_hds.ts
assets/hy17_hds/scene/pg_hy17_hds.ts
+7
-0
defaultData_hy17_hds.ts
assets/hy17_hds/script/defaultData_hy17_hds.ts
+4
-1
No files found.
assets/hy17_hds/scene/hy17_hds.ts
View file @
087be0a1
...
...
@@ -292,11 +292,11 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
}
async
recrodEnd
(
data
?:
any
)
{
pg
.
hw
.
addRecord
(
data
)
this
.
hideVoiceFlash
();
let
score
=
data
.
result
.
overall
;
pg
.
event
.
emit
(
'
layer_record_score
'
,
score
);
this
.
recording
=
false
;
this
.
startPlay
(
score
);
}
startPlay
(
score
)
{
...
...
@@ -418,9 +418,26 @@ export default class SceneComponent extends MyCocosSceneComponent {
cc
.
Tween
.
stopAllByTarget
(
icon_mountain
);
pg
.
view
.
visible
(
icon_mountain
,
false
)
}
sendData
()
{
return
new
Promise
(
res
=>
{
let
upData
:
any
=
{
word_count
:
this
.
data
.
word_count
,
sentence_count
:
this
.
data
.
sentence_count
,
zi_count
:
this
.
data
.
zi_count
,
score
:
this
.
score
,
};
let
details
=
pg
.
hw
.
getRecord
();
if
(
details
&&
details
.
length
>
0
)
{
upData
.
details
=
details
}
const
middleLayer
=
cc
.
find
(
'
middleLayer
'
).
getComponent
(
'
middleLayer
'
);
middleLayer
.
onHomeworkFinish
(
upData
,
()
=>
{
res
(
''
);
})
})
}
gameOver
()
{
this
.
sendData
()
pg
.
view
.
visible
(
this
.
sentence_box
,
false
)
// pg.event.emit('layer_ending_show', {
// coin: this.score
...
...
assets/hy17_hds/scene/pg_hy17_hds.ts
View file @
087be0a1
...
...
@@ -676,6 +676,13 @@ let pg = {
const
id
=
cc
.
audioEngine
.
playEffect
(
audio
.
clip
,
loop
);
resolve
(
id
);
})
},
records
:
[],
addRecord
(
data
)
{
this
.
records
.
push
(
data
)
},
getRecord
()
{
return
this
.
records
.
concat
();
}
},
signal
:
{
...
...
assets/hy17_hds/script/defaultData_hy17_hds.ts
View file @
087be0a1
export
const
defaultData
=
{
npcTitle
:
"
123
"
,
word_count
:
1
,
sentence_count
:
1
,
zi_count
:
1
,
npcTitle
:
"
123
"
,
"
recordFlag
"
:
false
,
"
title
"
:
""
,
"
questionText
"
:
""
,
"
questionTextAudio
"
:
""
,
"
questions
"
:
[
{
"
text
"
:
"
apple
"
,
"
time
"
:
2
},
{
"
text
"
:
"
pear
"
,
"
time
"
:
2
},
...
...
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