Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
dap-hu
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
Vũ Gia Vương
dap-hu
Commits
90249662
Commit
90249662
authored
Apr 01, 2025
by
Vũ Gia Vương
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add vibratePhone
parent
ab2834e3
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
1 deletion
+9
-1
HuController.ts
assets/scripts/GamePlay/HuController.ts
+9
-1
No files found.
assets/scripts/GamePlay/HuController.ts
View file @
90249662
...
@@ -129,12 +129,20 @@ export default class HuController extends cc.Component {
...
@@ -129,12 +129,20 @@ export default class HuController extends cc.Component {
eventTarget
.
emit
(
PLAY_ROLLING_SOUND
);
eventTarget
.
emit
(
PLAY_ROLLING_SOUND
);
cc
.
tween
(
this
.
node
)
cc
.
tween
(
this
.
node
)
.
repeat
(
5
,
cc
.
tween
(
this
.
node
)
.
repeat
(
5
,
cc
.
tween
(
this
.
node
)
.
call
(()
=>
this
.
vibratePhone
())
.
to
(
0.2
,
{
position
:
cc
.
v3
(
40
,
this
.
randomY
(),
0
)
})
.
to
(
0.2
,
{
position
:
cc
.
v3
(
40
,
this
.
randomY
(),
0
)
})
.
to
(
0.2
,
{
position
:
cc
.
v3
(
-
40
,
this
.
randomY
(),
0
)
}))
.
to
(
0.2
,
{
position
:
cc
.
v3
(
-
40
,
this
.
randomY
(),
0
)
})
)
.
to
(
0.2
,
{
position
:
cc
.
v3
(
0
,
0
,
0
)
})
.
to
(
0.2
,
{
position
:
cc
.
v3
(
0
,
0
,
0
)
})
.
start
();
.
start
();
}
}
private
vibratePhone
()
{
if
(
"vibrate"
in
navigator
)
{
navigator
.
vibrate
(
200
);
}
}
private
randomY
():
number
{
private
randomY
():
number
{
return
Math
.
random
()
*
100
-
50
;
return
Math
.
random
()
*
100
-
50
;
}
}
...
...
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