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
51e96fe0
Commit
51e96fe0
authored
Apr 01, 2025
by
Vũ Gia Vương
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix rotate
parent
f7ad56ad
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
204 additions
and
327 deletions
+204
-327
main.fire
assets/main.fire
+189
-299
HuController.ts
assets/scripts/GamePlay/HuController.ts
+15
-28
No files found.
assets/main.fire
View file @
51e96fe0
This diff is collapsed.
Click to expand it.
assets/scripts/GamePlay/HuController.ts
View file @
51e96fe0
...
...
@@ -5,8 +5,6 @@ const { ccclass, property } = cc._decorator;
@
ccclass
export
default
class
HuController
extends
cc
.
Component
{
@
property
(
sp
.
Skeleton
)
private
spine2
:
sp
.
Skeleton
=
null
;
private
_spine
:
sp
.
Skeleton
=
null
;
private
_pointStart
:
cc
.
Vec2
=
null
;
...
...
@@ -27,7 +25,7 @@ export default class HuController extends cc.Component {
this
.
_spine
.
setCompleteListener
(()
=>
{
console
.
log
(
'setCompleteListener'
,)
this
.
setRotateAnim
();
this
.
initBottle
();
});
this
.
scheduleOnce
(
this
.
setDeviceMotion
,
2
);
...
...
@@ -35,40 +33,27 @@ export default class HuController extends cc.Component {
this
.
initBottle
();
}
private
onRotateGuild
()
{
this
.
_spine
.
timeScale
=
0.5
;
this
.
scheduleOnce
(()
=>
{
this
.
_track
.
trackTime
=
this
.
_track
.
animationEnd
/
4
;
this
.
_spine
.
timeScale
=
0
;
},
1.2
);
}
private
initBottle
()
{
this
.
setRotateAnim
();
let
state
=
this
.
_spine
.
getState
();
this
.
_track
=
state
.
tracks
[
1
];
this
.
_track
.
trackTime
=
this
.
_track
.
animationEnd
/
4
;
this
.
_spine
.
setAnimation
(
1
,
"Rotate"
,
false
);
this
.
_spine
.
timeScale
=
this
.
_pointStart
?
0
:
0.5
;
this
.
_track
=
this
.
_spine
.
getState
().
tracks
[
1
];
this
.
_spine
.
timeScale
=
0
;
}
private
onTouchStart
(
event
:
cc
.
Event
.
EventTouch
):
void
{
eventTarget
.
emit
(
STOP_GUILD_ROTATE
);
// if (!this._pointStart) {
// this.setRotateAnim();
// }
this
.
_pointStart
=
event
.
getLocation
();
this
.
_spine
.
timeScale
=
0
;
}
private
onTouchEnd
():
void
{
this
.
scheduleOnce
(()
=>
this
.
_spine
.
timeScale
=
0
,
0.5
);
let
state
=
this
.
_spine
.
getState
();
let
track
=
state
.
tracks
[
1
];
if
(
track
.
trackTime
<
0
)
{
track
.
trackTime
=
0
;
}
this
.
scheduleOnce
(()
=>
{
this
.
_spine
.
timeScale
=
0
;
if
(
this
.
_track
.
trackTime
<
0
)
{
this
.
_track
.
trackTime
=
this
.
_track
.
animationEnd
-
0.01
;
}
},
0.5
);
}
private
onTouchMove
(
event
:
cc
.
Event
.
EventTouch
):
void
{
...
...
@@ -83,9 +68,11 @@ export default class HuController extends cc.Component {
this
.
_spine
.
timeScale
=
distance
>
0
?
-
1
:
1
;
}
private
setRotateAnim
():
void
{
this
.
_spine
.
setAnimation
(
1
,
"Rotate"
,
false
);
this
.
_spine
.
timeScale
=
this
.
_pointStart
?
0
:
0.5
;
private
onRotateGuild
()
{
this
.
_spine
.
timeScale
=
0.5
;
this
.
scheduleOnce
(()
=>
{
this
.
_spine
.
timeScale
=
0
;
},
1.2
);
}
private
setDeviceMotion
()
{
...
...
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