Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OPW_BoardGame_L5R4
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
OPW_BoardGame_L5R4
Commits
b739e1fc
Commit
b739e1fc
authored
Nov 25, 2022
by
李维
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完成语音评测页面
parent
f8b65a0e
Changes
10
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
959 additions
and
338 deletions
+959
-338
PronunciationTestLayer.js
...4/prefab/PronunciationTestLayer/PronunciationTestLayer.js
+322
-280
PronunciationTestLayer.prefab
...efab/PronunciationTestLayer/PronunciationTestLayer.prefab
+275
-4
audios.meta
..._BoardGame_L5R4/prefab/PronunciationTestLayer/audios.meta
+12
-0
right.wav
...dGame_L5R4/prefab/PronunciationTestLayer/audios/right.wav
+0
-0
right.wav.meta
..._L5R4/prefab/PronunciationTestLayer/audios/right.wav.meta
+7
-0
wrong.mp3
...dGame_L5R4/prefab/PronunciationTestLayer/audios/wrong.mp3
+0
-0
wrong.mp3.meta
..._L5R4/prefab/PronunciationTestLayer/audios/wrong.mp3.meta
+7
-0
progress_1.png.meta
...refab/PronunciationTestLayer/textures/progress_1.png.meta
+2
-2
OPW_BoardGame_L5R4.fire
assets/OPW_BoardGame_L5R4/scene/OPW_BoardGame_L5R4.fire
+322
-51
OPW_BoardGame_L5R4.ts
assets/OPW_BoardGame_L5R4/scene/OPW_BoardGame_L5R4.ts
+12
-1
No files found.
assets/OPW_BoardGame_L5R4/prefab/PronunciationTestLayer/PronunciationTestLayer.js
View file @
b739e1fc
This diff is collapsed.
Click to expand it.
assets/OPW_BoardGame_L5R4/prefab/PronunciationTestLayer/PronunciationTestLayer.prefab
View file @
b739e1fc
...
@@ -40,19 +40,22 @@
...
@@ -40,19 +40,22 @@
},
},
{
{
"__id__": 33
"__id__": 33
},
{
"__id__": 36
}
}
],
],
"_active":
tru
e,
"_active":
fals
e,
"_components": [
"_components": [
{
{
"__id__":
36
"__id__":
44
},
},
{
{
"__id__":
37
"__id__":
45
}
}
],
],
"_prefab": {
"_prefab": {
"__id__":
38
"__id__":
46
},
},
"_opacity": 255,
"_opacity": 255,
"_color": {
"_color": {
...
@@ -1342,6 +1345,272 @@
...
@@ -1342,6 +1345,272 @@
"fileId": "c8TTnwgvpL2Kb1J1NCiHC8",
"fileId": "c8TTnwgvpL2Kb1J1NCiHC8",
"sync": false
"sync": false
},
},
{
"__type__": "cc.Node",
"_name": "audioClips",
"_objFlags": 0,
"_parent": {
"__id__": 1
},
"_children": [
{
"__id__": 37
},
{
"__id__": 40
}
],
"_active": true,
"_components": [],
"_prefab": {
"__id__": 43
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 0,
"height": 0
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": ""
},
{
"__type__": "cc.Node",
"_name": "right",
"_objFlags": 0,
"_parent": {
"__id__": 36
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 38
}
],
"_prefab": {
"__id__": 39
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 0,
"height": 0
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": ""
},
{
"__type__": "cc.AudioSource",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 37
},
"_enabled": true,
"_clip": {
"__uuid__": "9ab937ea-56b2-433a-8bf2-fc5db40f33d6"
},
"_volume": 1,
"_mute": false,
"_loop": false,
"_firstlyEnabled": true,
"playOnLoad": false,
"preload": false,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__uuid__": "87e8bdef-072f-4642-b630-352bb34d47b4"
},
"fileId": "b72HtDZt5D1JFSlkV3dHvr",
"sync": false
},
{
"__type__": "cc.Node",
"_name": "wrong",
"_objFlags": 0,
"_parent": {
"__id__": 36
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 41
}
],
"_prefab": {
"__id__": 42
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 0,
"height": 0
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": ""
},
{
"__type__": "cc.AudioSource",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 40
},
"_enabled": true,
"_clip": {
"__uuid__": "2ca571b6-6cc3-4b8f-830e-e9dd662c0b6c"
},
"_volume": 1,
"_mute": false,
"_loop": false,
"_firstlyEnabled": true,
"playOnLoad": false,
"preload": false,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__uuid__": "87e8bdef-072f-4642-b630-352bb34d47b4"
},
"fileId": "0chKulT+1NHLcNjfZBplCI",
"sync": false
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__uuid__": "87e8bdef-072f-4642-b630-352bb34d47b4"
},
"fileId": "dessiBBVFGHYtjCtBgRQeZ",
"sync": false
},
{
{
"__type__": "cc.Widget",
"__type__": "cc.Widget",
"_name": "",
"_name": "",
...
@@ -1377,6 +1646,8 @@
...
@@ -1377,6 +1646,8 @@
"__id__": 1
"__id__": 1
},
},
"_enabled": true,
"_enabled": true,
"audioBeforeTest": "",
"recordWaitCount": 0,
"_id": ""
"_id": ""
},
},
{
{
...
...
assets/OPW_BoardGame_L5R4/prefab/PronunciationTestLayer/audios.meta
0 → 100644
View file @
b739e1fc
{
"ver": "1.1.2",
"uuid": "d5d7295b-e125-4e5f-b27f-fc93795c8e53",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
assets/OPW_BoardGame_L5R4/prefab/PronunciationTestLayer/audios/right.wav
0 → 100644
View file @
b739e1fc
File added
assets/OPW_BoardGame_L5R4/prefab/PronunciationTestLayer/audios/right.wav.meta
0 → 100644
View file @
b739e1fc
{
"ver": "2.0.1",
"uuid": "9ab937ea-56b2-433a-8bf2-fc5db40f33d6",
"downloadMode": 0,
"duration": 0.45102,
"subMetas": {}
}
\ No newline at end of file
assets/OPW_BoardGame_L5R4/prefab/PronunciationTestLayer/audios/wrong.mp3
0 → 100644
View file @
b739e1fc
File added
assets/OPW_BoardGame_L5R4/prefab/PronunciationTestLayer/audios/wrong.mp3.meta
0 → 100644
View file @
b739e1fc
{
"ver": "2.0.1",
"uuid": "2ca571b6-6cc3-4b8f-830e-e9dd662c0b6c",
"downloadMode": 0,
"duration": 0.6818,
"subMetas": {}
}
\ No newline at end of file
assets/OPW_BoardGame_L5R4/prefab/PronunciationTestLayer/textures/progress_1.png.meta
View file @
b739e1fc
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
"rawHeight": 51,
"rawHeight": 51,
"borderTop": 0,
"borderTop": 0,
"borderBottom": 0,
"borderBottom": 0,
"borderLeft":
0
,
"borderLeft":
38
,
"borderRight":
0
,
"borderRight":
16
,
"subMetas": {}
"subMetas": {}
}
}
}
}
...
...
assets/OPW_BoardGame_L5R4/scene/OPW_BoardGame_L5R4.fire
View file @
b739e1fc
This diff is collapsed.
Click to expand it.
assets/OPW_BoardGame_L5R4/scene/OPW_BoardGame_L5R4.ts
View file @
b739e1fc
...
@@ -27,6 +27,7 @@ const MSG_PLAYER_TO_HOME = "msg_player_to_home";
...
@@ -27,6 +27,7 @@ const MSG_PLAYER_TO_HOME = "msg_player_to_home";
const
MSG_PROFIX_END
=
"
__END__
"
;
const
MSG_PROFIX_END
=
"
__END__
"
;
const
DEBUG
=
true
;
const
DEBUG
=
true
;
const
TOTAL_SCORE
=
42
;
// 总分 - 双方分数之和等于 TOTAL_SCORE
const
TOTAL_SCORE
=
42
;
// 总分 - 双方分数之和等于 TOTAL_SCORE
const
AI_SUCCESS_RATE
=
0.85
;
// ai评测成功率
@
ccclass
@
ccclass
export
default
class
SceneComponent
extends
MyCocosSceneComponent
{
export
default
class
SceneComponent
extends
MyCocosSceneComponent
{
...
@@ -152,6 +153,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -152,6 +153,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
this
.
initLoadingLayer
();
this
.
initLoadingLayer
();
this
.
initOfflineLayer
();
this
.
initOfflineLayer
();
this
.
initPronunciationTestLayer
();
this
.
initPronunciationTestLayer
();
this
.
initCoolCat
();
this
.
initTurntable
();
this
.
initTurntable
();
this
.
initGemstone
();
this
.
initGemstone
();
this
.
initScore
();
this
.
initScore
();
...
@@ -210,6 +212,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -210,6 +212,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
initPronunciationTestLayer
()
{
initPronunciationTestLayer
()
{
const
loadingLayerBase
=
cc
.
find
(
"
Canvas/PronunciationTestLayer
"
);
const
loadingLayerBase
=
cc
.
find
(
"
Canvas/PronunciationTestLayer
"
);
this
.
pronunciationTestLayer
=
loadingLayerBase
.
getComponent
(
"
PronunciationTestLayer
"
);
this
.
pronunciationTestLayer
=
loadingLayerBase
.
getComponent
(
"
PronunciationTestLayer
"
);
this
.
pronunciationTestLayer
.
init
(
"
http://staging-teach.cdn.ireadabc.com/31952573236dd316a8ee1672d1614a1c.mp3
"
)
}
}
redPlayerNode
=
null
;
redPlayerNode
=
null
;
...
@@ -238,6 +241,12 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -238,6 +241,12 @@ export default class SceneComponent extends MyCocosSceneComponent {
this
.
treeNode
=
cc
.
find
(
"
Canvas/center_map/tree/stand
"
);
this
.
treeNode
=
cc
.
find
(
"
Canvas/center_map/tree/stand
"
);
}
}
// 初始化酷猫
coolCat
=
null
;
initCoolCat
()
{
this
.
coolCat
=
cc
.
find
(
"
Canvas/coolcatLand/coolcat
"
);
}
// 小人上树
// 小人上树
playerToTree
(
playerNode
)
{
playerToTree
(
playerNode
)
{
const
wordPos
=
this
.
treeNode
.
convertToWorldSpaceAR
(
cc
.
v2
(
0
,
0
))
const
wordPos
=
this
.
treeNode
.
convertToWorldSpaceAR
(
cc
.
v2
(
0
,
0
))
...
@@ -700,7 +709,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -700,7 +709,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
if
(
isAi
)
{
if
(
isAi
)
{
setTimeout
(()
=>
{
setTimeout
(()
=>
{
console
.
log
(
"
语音评测结束
"
)
console
.
log
(
"
语音评测结束
"
)
if
(
Math
.
random
()
>
1
)
{
if
(
Math
.
random
()
>
AI_SUCCESS_RATE
)
{
console
.
log
(
"
评测失败,后退
"
)
console
.
log
(
"
评测失败,后退
"
)
// 后退
// 后退
this
.
runEvent
(
MSG_PLAYER_TO_HOME
,
{
success
:
false
,
gemIndex
:
param
.
index
});
this
.
runEvent
(
MSG_PLAYER_TO_HOME
,
{
success
:
false
,
gemIndex
:
param
.
index
});
...
@@ -711,7 +720,9 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -711,7 +720,9 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
}
},
DEBUG
?
10
:
2000
);
},
DEBUG
?
10
:
2000
);
}
else
{
}
else
{
this
.
coolCat
.
active
=
false
;
this
.
pronunciationTestLayer
.
showVoice
(
this
.
gemstonesAll
[
param
.
index
],
this
.
gemstonesAll
[
param
.
index
].
__letter
).
then
(
res
=>
{
this
.
pronunciationTestLayer
.
showVoice
(
this
.
gemstonesAll
[
param
.
index
],
this
.
gemstonesAll
[
param
.
index
].
__letter
).
then
(
res
=>
{
this
.
coolCat
.
active
=
true
;
this
.
runEvent
(
MSG_PLAYER_TO_HOME
,
{
success
:
res
,
gemIndex
:
param
.
index
});
this
.
runEvent
(
MSG_PLAYER_TO_HOME
,
{
success
:
res
,
gemIndex
:
param
.
index
});
})
})
}
}
...
...
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