Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dg29_museum
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
dg29_museum
Commits
dd07eea8
Commit
dd07eea8
authored
Dec 22, 2023
by
Tt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
视频播放完成
parent
4e0035fe
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
476 additions
and
325 deletions
+476
-325
dg18_tianci.fire
assets/dg18_tianci/scene/dg18_tianci.fire
+415
-288
dg18_tianci.ts
assets/dg18_tianci/scene/dg18_tianci.ts
+49
-33
dg18_tianci_xiaodi.ts
assets/dg18_tianci/scene/dg18_tianci_xiaodi.ts
+8
-0
pg_dg18_tianci.ts
assets/dg18_tianci/scene/pg_dg18_tianci.ts
+1
-1
form.component.html
form/src/app/form/form.component.html
+2
-2
form.component.ts
form/src/app/form/form.component.ts
+1
-1
No files found.
assets/dg18_tianci/scene/dg18_tianci.fire
View file @
dd07eea8
This diff is collapsed.
Click to expand it.
assets/dg18_tianci/scene/dg18_tianci.ts
View file @
dd07eea8
import
macro
from
'
../script/A_Macro_dg18_tianci
'
import
{
asyncDelay
,
onHomeworkFinish
}
from
"
../script/util_dg18_tianci
"
;
import
{
MyCocosSceneComponent
}
from
"
../script/MyCocosSceneComponent_dg18_tianci
"
;
import
pg
from
"
./pg_dg18_tianci
"
;
import
pg
,
{
TimeCtrl
}
from
"
./pg_dg18_tianci
"
;
import
dg_xiaodi
from
"
./dg18_tianci_xiaodi
"
;
let
win
:
any
=
window
;
...
...
@@ -28,15 +28,11 @@ export default class SceneComponent extends MyCocosSceneComponent {
@
property
(
dg_xiaodi
)
xiaodi
:
dg_xiaodi
=
null
;
async
onLoadEnd
()
{
this
.
initVideoPlayer
();
this
.
showVideoPlayer
();
return
;
// TODO 加载完成后的逻辑写在这里, 下面的代码仅供参考
this
.
initData
();
this
.
initView
();
this
.
initEvent
();
this
.
showVideoPlayer
();
this
.
initVideoPlayer
();
this
.
xiaodi
.
playEnter
(
this
.
data
.
npcAudio
).
then
(()
=>
{
this
.
initGame
();
...
...
@@ -80,6 +76,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
this
.
label_tip_wait
.
active
=
false
;
this
.
label_tip_ing
.
active
=
false
;
this
.
rich_content
.
active
=
false
;
this
.
layout_video
.
active
=
false
;
}
// 事件监听
initEvent
()
{
...
...
@@ -244,11 +241,6 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
showNextBtn
()
{
}
showVideo
()
{
return
new
Promise
(
reslove
=>
{
reslove
(
''
)
})
}
onTouchRestart
()
{
// 处理展示视频内容
...
...
@@ -262,6 +254,11 @@ export default class SceneComponent extends MyCocosSceneComponent {
onTouchNext
()
{
if
(
this
.
recording
)
return
;
if
(
!
this
.
nextQuestion
)
{
pg
.
view
.
find
(
this
,
'
layout_game/img_question
'
).
active
=
false
;
this
.
btn_vioce
.
active
=
false
;
this
.
label_tip_wait
.
active
=
false
;
this
.
label_tip_ing
.
active
=
false
;
// 处理展示视频内容
this
.
showVideo
().
then
(()
=>
{
// 底部显示为重新查看
...
...
@@ -283,6 +280,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
@
property
(
cc
.
Label
)
currentTimeLabel
:
cc
.
Label
=
null
;
@
property
(
cc
.
Node
)
layout_video
:
cc
.
Node
=
null
;
@
property
(
cc
.
Node
)
videoControls
:
cc
.
Node
=
null
;
@
property
(
cc
.
Node
)
pauseButton
:
cc
.
Node
=
null
;
@
property
(
cc
.
Node
)
playButton
:
cc
.
Node
=
null
;
...
...
@@ -290,41 +288,59 @@ export default class SceneComponent extends MyCocosSceneComponent {
showUI
()
{
pg
.
view
.
visible
(
pg
.
view
.
find
(
this
,
'
bg
'
),
true
)
pg
.
view
.
visible
(
pg
.
view
.
find
(
this
,
'
question_img
'
),
true
)
pg
.
view
.
visible
(
pg
.
view
.
find
(
this
,
'
img_kuang
'
),
true
)
pg
.
view
.
visible
(
pg
.
view
.
find
(
this
,
'
label_title
'
),
true
)
pg
.
view
.
visible
(
pg
.
view
.
find
(
this
,
'
layout_record
'
),
true
)
pg
.
view
.
visible
(
pg
.
view
.
find
(
this
,
'
layout_game
'
),
true
)
pg
.
view
.
visible
(
pg
.
view
.
find
(
this
,
'
layout_xiaodi
'
),
true
)
this
.
xiaodi
.
showAll
();
}
hideUI
()
{
pg
.
view
.
visible
(
pg
.
view
.
find
(
this
,
'
bg
'
),
false
)
pg
.
view
.
visible
(
pg
.
view
.
find
(
this
,
'
question_img
'
),
false
)
pg
.
view
.
visible
(
pg
.
view
.
find
(
this
,
'
img_kuang
'
),
false
)
pg
.
view
.
visible
(
pg
.
view
.
find
(
this
,
'
label_title
'
),
false
)
pg
.
view
.
visible
(
pg
.
view
.
find
(
this
,
'
layout_record
'
),
false
)
pg
.
view
.
visible
(
pg
.
view
.
find
(
this
,
'
layout_game
'
),
false
)
pg
.
view
.
visible
(
pg
.
view
.
find
(
this
,
'
layout_xiaodi
'
),
false
)
}
playVideoEnd
()
{
this
.
xiaodi
.
hideAll
();
}
showVideoPlayer
()
{
this
.
layout_video
.
active
=
true
;
this
.
videoPlayer
.
stayOnBottom
=
true
;
this
.
_isReadyToPlay
=
false
;
this
.
videoPlayer
.
node
.
x
=
0
;
this
.
videoPlayer
.
node
.
y
=
0
;
this
.
videoPlayer
.
remoteURL
=
this
.
data
.
video
;
this
.
hideUI
();
pg
.
view
.
touchOn
(
this
.
playButton
,
this
.
play
,
this
);
pg
.
view
.
touchOn
(
this
.
pauseButton
,
this
.
pause
,
this
);
if
(
!
this
.
_isReadyToPlay
)
{
//首次播放
this
.
_isReadyToPlay
=
false
;
this
.
videoPlayer
.
remoteURL
=
this
.
data
.
video
;
pg
.
view
.
touchOn
(
this
.
playButton
,
this
.
play
,
this
);
pg
.
view
.
touchOn
(
this
.
pauseButton
,
this
.
pause
,
this
);
}
else
{
//重复播放
this
.
videoPlayer
.
currentTime
=
0
;
this
.
_isPlayComplated
=
false
;
this
.
play
();
}
this
.
hideUI
();
setTimeout
(()
=>
{
this
.
videoPlayer
.
stayOnBottom
=
true
;
},
2000
);
this
.
videoPlayer
.
stayOnBottom
=
false
;
this
.
videoControls
.
active
=
false
;
},
3000
);
}
private
timeCtrl
:
TimeCtrl
;
showVideo
()
{
return
new
Promise
(
async
(
reslove
)
=>
{
this
.
showVideoPlayer
();
this
.
timeCtrl
=
pg
.
time
.
delayCtrl
()
this
.
timeCtrl
.
fillTime
(
99999
);
await
this
.
timeCtrl
.
wait
();
reslove
(
''
)
})
}
hideVideo
()
{
this
.
timeCtrl
.
reset
();
this
.
videoPlayer
.
node
.
x
=
-
10000
;
this
.
videoPlayer
.
node
.
y
=
-
10000
;
this
.
layout_video
.
active
=
false
;
this
.
showUI
();
}
initVideoPlayer
()
{
this
.
videoPlayer
.
node
.
on
(
'
ready-to-play
'
,
()
=>
{
console
.
log
(
'
ready-to-play
'
);
...
...
@@ -378,7 +394,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
this
.
playButton
.
active
=
false
;
this
.
pauseButton
.
active
=
false
;
// 循环播放下一个
this
.
playVideoEnd
();
this
.
hideVideo
();
});
cc
.
view
.
setResizeCallback
((
params
)
=>
{
console
.
log
(
'
Resize
'
,
params
);
...
...
@@ -578,7 +594,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
},
0.5
)
}
pg
.
view
.
touchOn
(
pg
.
view
.
find
(
this
,
'
layout_xiaodi/btn_go
'
),
this
.
onTouchExit
,
this
);
pg
.
view
.
setString
(
pg
.
view
.
find
(
this
,
'
layout_xiaodi/btn_go/t
xt
'
),
this
.
data
.
npcTitle
)
pg
.
view
.
setString
(
pg
.
view
.
find
(
this
,
'
layout_xiaodi/btn_go/t
ext
'
),
this
.
data
.
npcAudioText
)
pg
.
view
.
find
(
this
,
'
layout_xiaodi
'
).
active
=
true
;
pg
.
view
.
find
(
this
,
'
layout_xiaodi
'
).
getComponent
(
dg_xiaodi
).
playOver
(
this
.
data
.
npcAudioEnd
)
}
...
...
assets/dg18_tianci/scene/dg18_tianci_xiaodi.ts
View file @
dd07eea8
...
...
@@ -10,6 +10,14 @@ export default class dg_xiaodi extends cc.Component {
onLoad
()
{
}
hideAll
()
{
this
.
playEnterEnd
();
this
.
playQuestionVoiceEnd
();
this
.
node
.
active
=
false
;
}
showAll
()
{
this
.
node
.
active
=
true
;
}
private
audioIdEnter
:
any
;
playEnter
(
audioUrl
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
...
...
assets/dg18_tianci/scene/pg_dg18_tianci.ts
View file @
dd07eea8
...
...
@@ -102,7 +102,7 @@ class Signal<T = void> {
}
}
class
TimeCtrl
{
export
class
TimeCtrl
{
private
current
:
number
;
constructor
()
{
this
.
current
=
0
;
...
...
form/src/app/form/form.component.html
View file @
dd07eea8
...
...
@@ -85,8 +85,6 @@
<div
style=
"padding: 10px;background-color: #fff;"
>
<div
class=
"border-dashed"
style=
"margin: 20px;width: 1300px;"
>
<span
style=
"font-size: 20px;"
>
小迪标题:
</span>
<input
type=
"text"
nz-input
[(
ngModel
)]="
item
.
npcTitle
"
(
blur
)="
save
()"
>
<span
style=
"font-size: 20px;"
>
小迪开始音频:
</span>
<div
style=
"display:flex ;"
>
<div>
...
...
@@ -98,6 +96,8 @@
<span>
{{ item.npcAudioName}}
</span>
</div>
</div>
<span
style=
"font-size: 20px;"
>
小迪结束按钮文字:
</span>
<input
type=
"text"
nz-input
[(
ngModel
)]="
item
.
npcAudioText
"
(
blur
)="
save
()"
>
<span
style=
"font-size: 20px;"
>
小迪结束音频:
</span>
<div
style=
"display:flex ;"
>
<div>
...
...
form/src/app/form/form.component.ts
View file @
dd07eea8
...
...
@@ -15,7 +15,7 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
// 储存数据用
saveKey
=
"
dg29_museum_1
"
;
item
=
{
npc
Title
:
""
,
npc
AudioText
:
""
,
npcAudio
:
""
,
npcAudioName
:
""
,
npcAudioEnd
:
""
,
...
...
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