Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
SSAPP2501
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
SSAPP2501
Commits
3f9d8885
Commit
3f9d8885
authored
Aug 02, 2025
by
Tt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
4b67fd36
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
44 deletions
+48
-44
SSAPP2501.ts
assets/SSAPP2501/scene/SSAPP2501.ts
+48
-44
No files found.
assets/SSAPP2501/scene/SSAPP2501.ts
View file @
3f9d8885
...
...
@@ -241,7 +241,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
// 获取当前页码
const
currentPage
=
Game
.
getIns
().
getCurrentPageNum
();
// 根据当前页码计算初始位置和目标位置
const
initialX
=
-
1500
+
1920
*
currentPage
;
const
targetX
=
-
400
+
1920
*
currentPage
;
...
...
@@ -364,7 +364,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
// 获取当前页码
const
currentPage
=
Game
.
getIns
().
getCurrentPageNum
();
// 根据火苗编号调整消防车位置
// fire_0~fire_2 消防车位置 x=-400,fire_3~fire_5 消防车位置 x=-185
// 并根据当前页码进行偏移
...
...
@@ -417,15 +417,13 @@ export default class SceneComponent extends MyCocosSceneComponent {
// 切换到持续喷水动画
pg
.
view
.
addDBAnimationCallback
(
this
.
node_firetruck_flush
,
null
)
pg
.
view
.
playDBAnimation
(
this
.
node_firetruck_flush
,
'
持续喷水
'
,
1
);
this
.
scheduleOnce
(()
=>
{
pg
.
view
.
addDBAnimationCallback
(
this
.
node_firetruck_flush
,
()
=>
{
pg
.
view
.
addDBAnimationCallback
(
this
.
node_firetruck_flush
,
null
)
this
.
node_firetruck_flush
.
active
=
false
;
})
pg
.
view
.
playDBAnimation
(
this
.
node_firetruck_flush
,
'
收水
'
,
1
);
this
.
onFireSuccess
();
this
.
touching
=
false
;
},
1
)
pg
.
view
.
addDBAnimationCallback
(
this
.
node_firetruck_flush
,
()
=>
{
pg
.
view
.
addDBAnimationCallback
(
this
.
node_firetruck_flush
,
null
)
this
.
node_firetruck_flush
.
active
=
false
;
})
pg
.
view
.
playDBAnimation
(
this
.
node_firetruck_flush
,
'
收水
'
,
1
);
this
.
touching
=
false
;
this
.
showCard
();
})
pg
.
view
.
playDBAnimation
(
this
.
node_firetruck_flush
,
'
喷水
'
,
1
);
}
...
...
@@ -458,7 +456,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
// 检查当前页面是否所有火苗都已处理完毕
if
(
this
.
activeFireNodes
.
length
===
5
)
{
if
(
this
.
activeFireNodes
.
length
===
0
)
{
// 延迟一段时间后检查是否需要切换到下一页
this
.
scheduleOnce
(()
=>
{
// 检查是否需要进入下一页
...
...
@@ -479,12 +477,49 @@ export default class SceneComponent extends MyCocosSceneComponent {
fireNode
.
active
=
true
;
}
}
nextPage
()
{
nextPage
()
{
// 切换到下一页
Game
.
getIns
().
addPage
();
this
.
showPage
();
}
showCard
()
{
// 显示卡片
const
currentData
=
this
.
currentFireNode
.
data
;
console
.
log
(
'
showCard
'
,
currentData
)
}
/**
* 更新录音界面的显示状态
* @param hide 是否隐藏录音界面
*/
private
updateLayoutSpeak
(
hide
?:
boolean
)
{
if
(
!
hide
)
{
// 显示录音界面
this
.
layout_speak
.
active
=
true
;
// 获取UI元素
let
ske
=
pg
.
view
.
find
(
this
.
layout_speak
,
'
speak_ske
'
);
let
btn_start
=
pg
.
view
.
find
(
this
.
layout_speak
,
'
btn_start
'
);
let
btn_stop
=
pg
.
view
.
find
(
this
.
layout_speak
,
'
btn_stop
'
);
// 绑定按钮事件
pg
.
view
.
touchOn
(
btn_start
,
this
.
onTouchRecord
,
this
);
pg
.
view
.
touchOn
(
btn_stop
,
this
.
onTouchRecordEnd
,
this
);
// 设置动画初始状态(几乎静止)
pg
.
view
.
playDBAnimation
(
ske
,
'
newAnimation
'
,
0
);
ske
.
getComponent
(
dragonBones
.
ArmatureDisplay
).
timeScale
=
0.00001
;
// 显示开始按钮,隐藏停止按钮
btn_start
.
active
=
true
;
btn_stop
.
active
=
false
;
}
else
{
// 隐藏录音界面
this
.
layout_speak
.
active
=
false
;
}
}
/**
* 游戏帧更新函数
...
...
@@ -770,37 +805,6 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
}
/**
* 更新录音界面的显示状态
* @param hide 是否隐藏录音界面
*/
private
updateLayoutSpeak
(
hide
?:
boolean
)
{
if
(
!
hide
)
{
// 显示录音界面
this
.
layout_speak
.
active
=
true
;
// 获取UI元素
let
ske
=
pg
.
view
.
find
(
this
.
layout_speak
,
'
speak_ske
'
);
let
btn_start
=
pg
.
view
.
find
(
this
.
layout_speak
,
'
btn_start
'
);
let
btn_stop
=
pg
.
view
.
find
(
this
.
layout_speak
,
'
btn_stop
'
);
// 绑定按钮事件
pg
.
view
.
touchOn
(
btn_start
,
this
.
onTouchRecord
,
this
);
pg
.
view
.
touchOn
(
btn_stop
,
this
.
onTouchRecordEnd
,
this
);
// 设置动画初始状态(几乎静止)
pg
.
view
.
playDBAnimation
(
ske
,
'
newAnimation
'
,
0
);
ske
.
getComponent
(
dragonBones
.
ArmatureDisplay
).
timeScale
=
0.00001
;
// 显示开始按钮,隐藏停止按钮
btn_start
.
active
=
true
;
btn_stop
.
active
=
false
;
}
else
{
// 隐藏录音界面
this
.
layout_speak
.
active
=
false
;
}
}
/**
* 更新提示状态
* 根据不同状态显示不同的提示图标和播放相应音效
...
...
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