Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
hy01_danci
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
hy01_danci
Commits
e9dd4b30
Commit
e9dd4b30
authored
Jul 11, 2023
by
Tt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hy01卡死测试
parent
bfd1bb43
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
37 additions
and
5 deletions
+37
-5
LayerBack_hy01_danci.ts
assets/hy01_danci/common/layer_back/LayerBack_hy01_danci.ts
+3
-0
ImgVoice_hy01_danci.ts
assets/hy01_danci/common/script/ImgVoice_hy01_danci.ts
+4
-0
LayerRecord_hy01_danci.ts
assets/hy01_danci/common/script/LayerRecord_hy01_danci.ts
+4
-0
hy01_danci.ts
assets/hy01_danci/scene/hy01_danci.ts
+25
-5
pg_hy01_danci.ts
assets/hy01_danci/scene/pg_hy01_danci.ts
+1
-0
No files found.
assets/hy01_danci/common/layer_back/LayerBack_hy01_danci.ts
View file @
e9dd4b30
...
...
@@ -16,6 +16,9 @@ export default class LayerBack extends cc.Component {
this
.
initView
();
this
.
initEvent
();
}
protected
onDestroy
():
void
{
this
.
unscheduleAllCallbacks
();
}
private
label_title
:
cc
.
Node
;
...
...
assets/hy01_danci/common/script/ImgVoice_hy01_danci.ts
View file @
e9dd4b30
...
...
@@ -13,6 +13,9 @@ export default class ImgVoice extends cc.Component {
this
.
initView
();
this
.
initEvent
();
}
protected
onDestroy
():
void
{
this
.
unscheduleAllCallbacks
();
}
initView
()
{
this
.
img_npc_voice
=
this
.
node
;
}
...
...
@@ -32,6 +35,7 @@ export default class ImgVoice extends cc.Component {
}
playVoiceRunning
()
{
this
.
playVoiceCount
++
;
if
(
!
this
.
img_npc_voice
)
return
;
let
p1
=
this
.
img_npc_voice
.
getChildByName
(
'
p1
'
)
let
p2
=
this
.
img_npc_voice
.
getChildByName
(
'
p2
'
)
let
p3
=
this
.
img_npc_voice
.
getChildByName
(
'
p3
'
)
...
...
assets/hy01_danci/common/script/LayerRecord_hy01_danci.ts
View file @
e9dd4b30
...
...
@@ -26,6 +26,9 @@ export default class LayerRecord extends cc.Component {
this
.
initEvent
();
this
.
showVoiceWhite
();
}
protected
onDestroy
():
void
{
this
.
unscheduleAllCallbacks
();
}
private
letter
:
string
;
private
targetTime
:
number
;
private
recordAudio
:
string
;
...
...
@@ -121,6 +124,7 @@ export default class LayerRecord extends cc.Component {
playVoiceRunning
()
{
this
.
playVoiceCount
++
;
let
btn_play
=
pg
.
view
.
find
(
this
.
layout_record
,
'
btn_play
'
);
if
(
!
btn_play
)
return
;
let
p0
=
btn_play
.
getChildByName
(
'
p0
'
)
let
p1
=
btn_play
.
getChildByName
(
'
p1
'
)
let
p2
=
btn_play
.
getChildByName
(
'
p2
'
)
...
...
assets/hy01_danci/scene/hy01_danci.ts
View file @
e9dd4b30
...
...
@@ -45,6 +45,9 @@ export default class SceneComponent extends MyCocosSceneComponent {
})
pg
.
event
.
emit
(
'
npc_layer_back_init
'
,
this
.
data
)
}
protected
onDestroy
():
void
{
pg
.
event
.
clear
();
}
_cantouch
=
null
;
private
list
:
Array
<
{
type
,
text
,
right
,
imgage
,
duration
,
content
,
audio
}
>
;
...
...
@@ -52,6 +55,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
private
score
:
number
;
private
scoreList
:
Array
<
number
>
;
private
tempCount
:
number
;
private
maxCurrent
:
number
;
initData
()
{
// 所有全局变量 默认都是null
this
.
_cantouch
=
true
;
...
...
@@ -61,6 +65,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
this
.
recordFlag
=
data
.
recordFlag
;
this
.
list
=
data
.
questions
[
0
].
options
;
this
.
scoreList
=
this
.
list
.
map
(()
=>
3
);
this
.
maxCurrent
=
0
;
this
.
layers
=
[];
}
...
...
@@ -91,9 +96,11 @@ export default class SceneComponent extends MyCocosSceneComponent {
console
.
log
(
move
.
toString
());
if
(
move
.
x
<
-
10
)
{
this
.
touchForbid
=
true
;
console
.
log
(
"
lastPage
"
)
this
.
lastPage
();
}
else
if
(
move
.
x
>
10
)
{
this
.
touchForbid
=
true
;
console
.
log
(
"
nextPage
"
)
this
.
nextPage
();
}
}
...
...
@@ -102,7 +109,15 @@ export default class SceneComponent extends MyCocosSceneComponent {
this
.
preLayer
();
}
nextPage
()
{
this
.
nextLayer
();
if
(
this
.
recordFlag
)
{
if
(
this
.
count
+
1
<=
this
.
maxCurrent
)
{
this
.
nextLayer
();
}
else
{
this
.
touchForbid
=
false
;
}
}
else
{
this
.
nextLayer
();
}
}
resetView
()
{
this
.
layer_game
.
removeAllChildren
();
...
...
@@ -172,6 +187,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
pg
.
audio
.
playAudioByUrl
(
this
.
CurrentData
.
audio
,
()
=>
{
this
.
currentAudioId
=
null
;
com
.
playVoiceEnd
();
this
.
touchForbid
=
false
;
pg
.
event
.
emit
(
'
layer_record_open
'
,
{
letter
:
this
.
CurrentData
.
content
,
targetTime
:
this
.
CurrentData
.
duration
,
...
...
@@ -195,9 +211,12 @@ export default class SceneComponent extends MyCocosSceneComponent {
pg
.
audio
.
playAudioByUrl
(
this
.
CurrentData
.
audio
,
()
=>
{
this
.
currentAudioId
=
null
;
com
.
playVoiceEnd
();
this
.
touchForbid
=
true
;
this
.
touchForbid
=
false
;
this
.
nextLayer
();
this
.
scheduleOnce
(()
=>
{
this
.
touchForbid
=
false
;
this
.
nextLayer
();
},
3
)
// 动画过来播放之后等待三秒
// pg.event.once('layer_coin_show_coin_end', () => {
// this.touchForbid = false;
// this.nextLayer();
...
...
@@ -249,7 +268,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
pg
.
event
.
once
(
'
layer_coin_show_coin_end
'
,
()
=>
{
this
.
nextLayer
();
})
// 动画回调
pg
.
event
.
emit
(
'
layer_coin_show_coin
'
,
1
)
//1 2 3硬币数量
pg
.
event
.
emit
(
'
layer_coin_show_coin
'
,
2
)
//1 2 3硬币数量
})
pg
.
event
.
emit
(
'
layer_right_show_good
'
)
}
else
{
...
...
@@ -312,6 +331,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
this
.
scheduleOnce
(()
=>
{
this
.
touchForbid
=
false
;
this
.
count
++
;
this
.
maxCurrent
=
Math
.
max
(
this
.
maxCurrent
,
this
.
count
);
this
.
startPlay
();
},
1
)
}
...
...
assets/hy01_danci/scene/pg_hy01_danci.ts
View file @
e9dd4b30
...
...
@@ -391,6 +391,7 @@ let pg = {
let
node
=
item
.
node
?
item
.
node
:
item
;
if
(
!
node
)
return
;
let
component
=
node
.
getComponent
(
cc
.
Label
);
//组件功能 非node的功能
component
.
cacheMode
=
cc
.
Label
.
CacheMode
.
CHAR
;
component
.
string
=
text
;
return
true
;
},
...
...
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