Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dg28_drag
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
dg28_drag
Commits
e6a89b70
Commit
e6a89b70
authored
Dec 16, 2023
by
Tt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
基础音效增加完成
parent
7558dbf9
Changes
3
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
372 additions
and
27 deletions
+372
-27
dg28_drag.fire
assets/dg28_drag/scene/dg28_drag.fire
+361
-25
dg28_drag.ts
assets/dg28_drag/scene/dg28_drag.ts
+7
-1
pg.ts
assets/dg28_drag/scene/pg.ts
+4
-1
No files found.
assets/dg28_drag/scene/dg28_drag.fire
View file @
e6a89b70
This diff is collapsed.
Click to expand it.
assets/dg28_drag/scene/dg28_drag.ts
View file @
e6a89b70
...
...
@@ -181,6 +181,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
meetCurrentTouchNode
:
cc
.
Node
;
onTouchMeetStart
(
event
)
{
this
.
playLocalAudio
(
'
dragdown
'
)
this
.
waitTime
=
8
;
if
(
this
.
guide
==
1
)
return
;
let
node
=
event
.
target
;
...
...
@@ -318,6 +319,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
vegetableCurrentTouchNode
:
cc
.
Node
;
onTouchVegetableStart
(
event
)
{
this
.
playLocalAudio
(
'
dragdown
'
)
this
.
waitTime
=
8
;
if
(
this
.
guide
==
0
)
return
;
let
node
=
event
.
target
;
...
...
@@ -400,15 +402,17 @@ export default class SceneComponent extends MyCocosSceneComponent {
node
.
x
=
SceneComponent
.
pieStartPos
.
x
;
node
.
y
=
SceneComponent
.
pieStartPos
.
y
;
this
.
updateItemPie
(
node
,
this
.
currentQuestion
);
this
.
playLocalAudio
(
'
pie_drop
'
)
cc
.
tween
(
node
)
.
to
(
0.5
,
{
x
:
SceneComponent
.
pieDefaultPos
.
x
,
y
:
SceneComponent
.
pieDefaultPos
.
y
-
50
})
.
to
(
0.06
,
{
x
:
SceneComponent
.
pieDefaultPos
.
x
,
y
:
SceneComponent
.
pieDefaultPos
.
y
})
.
call
(()
=>
{
this
.
playLocalAudio
(
'
boom
'
)
let
ani
=
pg
.
view
.
find
(
node
,
'
ani
'
)
ani
.
active
=
true
;
pg
.
view
.
playDBAnimation
(
ani
,
'
normal
'
,
1
)
node
.
parent
=
this
.
currentMain
}).
delay
(
0.
5
).
call
(()
=>
{
}).
delay
(
0.
9
).
call
(()
=>
{
this
.
nextStage
();
})
.
start
();
...
...
@@ -525,6 +529,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
this
.
discardCurrent
();
// 中间移出
cc
.
tween
(
this
.
currentMain
).
by
(
1
,
{
y
:
-
1800
}).
start
();
this
.
playLocalAudio
(
'
nextgame
'
)
// 中间移入
let
node
=
this
.
nextLayoutMain
(
this
.
nextQuestion
);
// 切换题目主体
...
...
@@ -545,6 +550,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
this
.
createCurrent
();
// 中间移出
cc
.
tween
(
this
.
currentMain
).
by
(
1
,
{
y
:
-
1800
}).
start
();
this
.
playLocalAudio
(
'
nextgame
'
)
// 中间移入
let
node
=
this
.
nextLayoutMain
(
this
.
preQuestion
);
// 切换题目主体
...
...
assets/dg28_drag/scene/pg.ts
View file @
e6a89b70
...
...
@@ -570,7 +570,10 @@ let pg = {
audio
:
{
playAudioByUrl
(
audio_url
,
cb
=
null
,
loadCb
=
null
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
if
(
!
audio_url
)
return
resolve
(
null
);
if
(
!
audio_url
)
{
cb
&&
cb
();
return
resolve
(
null
);
}
cc
.
assetManager
.
loadRemote
(
audio_url
,
(
err
,
audioClip
:
any
)
=>
{
cc
.
audioEngine
.
stopAllEffects
();
const
audioId
=
cc
.
audioEngine
.
play
(
audioClip
,
false
,
0.8
);
...
...
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