Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
hy04_pinci
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
hy04_pinci
Commits
676f5b9b
Commit
676f5b9b
authored
Jul 02, 2023
by
WangFan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1、透明度调整 2、添加正确、错误音效 3、自动播放音频
parent
ba4cbdee
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
38 additions
and
3 deletions
+38
-3
hy04_pinci.fire
assets/hy04_pinci/scene/hy04_pinci.fire
+1
-1
hy04_pinci.ts
assets/hy04_pinci/scene/hy04_pinci.ts
+10
-1
defaultData_hy04_pinci.ts
assets/hy04_pinci/script/defaultData_hy04_pinci.ts
+1
-1
res.meta
assets/hy04_pinci/textures/hy04/res.meta
+12
-0
fail.mp3
assets/hy04_pinci/textures/hy04/res/fail.mp3
+0
-0
fail.mp3.meta
assets/hy04_pinci/textures/hy04/res/fail.mp3.meta
+7
-0
right.mp3
assets/hy04_pinci/textures/hy04/res/right.mp3
+0
-0
right.mp3.meta
assets/hy04_pinci/textures/hy04/res/right.mp3.meta
+7
-0
No files found.
assets/hy04_pinci/scene/hy04_pinci.fire
View file @
676f5b9b
...
@@ -563,7 +563,7 @@
...
@@ -563,7 +563,7 @@
"_active": true,
"_active": true,
"_components": [],
"_components": [],
"_prefab": null,
"_prefab": null,
"_opacity":
25
5,
"_opacity":
12
5,
"_color": {
"_color": {
"__type__": "cc.Color",
"__type__": "cc.Color",
"r": 255,
"r": 255,
...
...
assets/hy04_pinci/scene/hy04_pinci.ts
View file @
676f5b9b
...
@@ -82,6 +82,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -82,6 +82,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
private
layer_record
:
cc
.
Node
;
private
layer_record
:
cc
.
Node
;
private
layer_word
:
cc
.
Node
;
private
layer_word
:
cc
.
Node
;
private
layers
:
Array
<
cc
.
Node
>
;
private
layers
:
Array
<
cc
.
Node
>
;
private
res_audio
:
cc
.
Node
;
initView
()
{
initView
()
{
this
.
layer_record
=
pg
.
view
.
find
(
this
,
'
layer_record
'
)
this
.
layer_record
=
pg
.
view
.
find
(
this
,
'
layer_record
'
)
this
.
layer_word
=
pg
.
view
.
find
(
this
,
'
layer_word
'
)
this
.
layer_word
=
pg
.
view
.
find
(
this
,
'
layer_word
'
)
...
@@ -98,6 +99,8 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -98,6 +99,8 @@ export default class SceneComponent extends MyCocosSceneComponent {
this
.
lower_word
=
pg
.
view
.
find
(
this
.
layer_word
,
"
lower_word
"
);
this
.
lower_word
=
pg
.
view
.
find
(
this
.
layer_word
,
"
lower_word
"
);
this
.
res_audio
=
pg
.
view
.
find
(
this
,
"
res/audio
"
)
this
.
showWord
()
this
.
showWord
()
}
}
...
@@ -112,7 +115,6 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -112,7 +115,6 @@ export default class SceneComponent extends MyCocosSceneComponent {
// 校验是否正确
// 校验是否正确
checkIsRight
()
{
checkIsRight
()
{
console
.
log
(
this
.
curIndex
+
1
<
SceneComponent
.
Word_List_Len
);
console
.
log
(
this
.
curIndex
+
1
<
SceneComponent
.
Word_List_Len
);
if
((
this
.
curIndex
+
1
)
<
SceneComponent
.
Word_List_Len
)
{
if
((
this
.
curIndex
+
1
)
<
SceneComponent
.
Word_List_Len
)
{
this
.
curIndex
++
this
.
curIndex
++
this
.
showWord
()
this
.
showWord
()
...
@@ -125,9 +127,14 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -125,9 +127,14 @@ export default class SceneComponent extends MyCocosSceneComponent {
private
wordBgList
:
Array
<
cc
.
Node
>
;
private
wordBgList
:
Array
<
cc
.
Node
>
;
private
wordList
:
Array
<
cc
.
Node
>
;
private
wordList
:
Array
<
cc
.
Node
>
;
private
get
CurrentWord
():
any
{
private
get
CurrentWord
():
any
{
// 默认播放当前音频
let
audio_url
=
this
.
wordDataList
[
this
.
curIndex
].
audio
if
(
audio_url
)
pg
.
audio
.
playAudioByUrl
(
audio_url
)
return
this
.
wordDataList
[
this
.
curIndex
];
return
this
.
wordDataList
[
this
.
curIndex
];
}
}
playCurrentVideo
()
{
}
nextWord
()
{
nextWord
()
{
let
success
=
true
;
let
success
=
true
;
for
(
let
idx
in
this
.
successGroupIds
)
{
for
(
let
idx
in
this
.
successGroupIds
)
{
...
@@ -420,6 +427,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -420,6 +427,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
if
((
groupId
||
groupId
==
0
)
&&
node
.
data
[
0
].
data
.
group
==
groupId
)
{
if
((
groupId
||
groupId
==
0
)
&&
node
.
data
[
0
].
data
.
group
==
groupId
)
{
console
.
log
(
groupId
)
console
.
log
(
groupId
)
// 正确了 需要处理效果
// 正确了 需要处理效果
pg
.
audio
.
playLocalAudio
(
pg
.
view
.
find
(
this
.
res_audio
,
"
right
"
))
let
nodes
=
node
.
data
;
let
nodes
=
node
.
data
;
let
targets
=
this
.
getWordBgByGroup
(
groupId
);
let
targets
=
this
.
getWordBgByGroup
(
groupId
);
nodes
.
forEach
(
item
=>
{
nodes
.
forEach
(
item
=>
{
...
@@ -433,6 +441,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -433,6 +441,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
node
.
off
(
cc
.
Node
.
EventType
.
TOUCH_END
,
this
.
onTouchEnd
,
this
);
node
.
off
(
cc
.
Node
.
EventType
.
TOUCH_END
,
this
.
onTouchEnd
,
this
);
this
.
nextWord
();
this
.
nextWord
();
}
else
{
}
else
{
pg
.
audio
.
playLocalAudio
(
pg
.
view
.
find
(
this
.
res_audio
,
"
fail
"
))
let
subX
=
node
.
x
-
node
.
orgPos
.
x
;
let
subX
=
node
.
x
-
node
.
orgPos
.
x
;
let
subY
=
node
.
y
-
node
.
orgPos
.
y
;
let
subY
=
node
.
y
-
node
.
orgPos
.
y
;
node
.
x
-=
subX
;
node
.
x
-=
subX
;
...
...
assets/hy04_pinci/script/defaultData_hy04_pinci.ts
View file @
676f5b9b
...
@@ -3,7 +3,7 @@ export const defaultData = {
...
@@ -3,7 +3,7 @@ export const defaultData = {
{
{
"
questionAudio
"
:
""
,
"
duration
"
:
120
,
"
questionAudio
"
:
""
,
"
duration
"
:
120
,
"
type
"
:
"
img
"
,
"
image
"
:
"
http://staging-teach.cdn.ireadabc.com/710feaeb43f2b610cfe6946de05c3567.png
"
,
"
type
"
:
"
img
"
,
"
image
"
:
"
http://staging-teach.cdn.ireadabc.com/710feaeb43f2b610cfe6946de05c3567.png
"
,
"
audio
"
:
""
,
"
text
"
:
""
,
"
right
"
:
false
,
"
audio
"
:
"
http://staging-teach.cdn.ireadabc.com/48c425442c9d555e7f1226b81d4b8fa6_l.mp3
"
,
"
text
"
:
""
,
"
right
"
:
false
,
"
letterList
"
:
[{
"
text
"
:
"
c
"
},
{
"
text
"
:
"
a
"
},
{
"
text
"
:
"
p
"
},
{
"
text
"
:
"
able
"
}]
"
letterList
"
:
[{
"
text
"
:
"
c
"
},
{
"
text
"
:
"
a
"
},
{
"
text
"
:
"
p
"
},
{
"
text
"
:
"
able
"
}]
},
},
{
{
...
...
assets/hy04_pinci/textures/hy04/res.meta
0 → 100644
View file @
676f5b9b
{
"ver": "1.1.2",
"uuid": "6cb034d1-7891-4c4f-bc13-f0cddeac01ff",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
assets/hy04_pinci/textures/hy04/res/fail.mp3
0 → 100644
View file @
676f5b9b
File added
assets/hy04_pinci/textures/hy04/res/fail.mp3.meta
0 → 100644
View file @
676f5b9b
{
"ver": "2.0.1",
"uuid": "8720b6ba-1b31-4e59-9cbe-c6ab93b53e94",
"downloadMode": 0,
"duration": 0.835918,
"subMetas": {}
}
\ No newline at end of file
assets/hy04_pinci/textures/hy04/res/right.mp3
0 → 100644
View file @
676f5b9b
File added
assets/hy04_pinci/textures/hy04/res/right.mp3.meta
0 → 100644
View file @
676f5b9b
{
"ver": "2.0.1",
"uuid": "8b764508-39fd-4eb9-98f5-7df481685fa5",
"downloadMode": 0,
"duration": 2.220417,
"subMetas": {}
}
\ No newline at end of file
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