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
01f0c342
Commit
01f0c342
authored
Mar 31, 2025
by
Vũ Gia Vương
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Initial commit
parent
5165324e
Pipeline
#5650
canceled with stages
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
105 additions
and
13 deletions
+105
-13
main.fire
assets/main.fire
+87
-3
Cartoon Short Version 2_01.ogg
assets/resources/sound/Cartoon Short Version 2_01.ogg
+0
-0
HuController.ts
assets/scripts/GamePlay/HuController.ts
+13
-8
ActionScreen.ts
assets/scripts/UI/ActionScreen.ts
+5
-2
No files found.
assets/main.fire
View file @
01f0c342
...
...
@@ -96,10 +96,10 @@
"_active": true,
"_components": [
{
"__id__": 8
2
"__id__": 8
4
},
{
"__id__": 8
3
"__id__": 8
5
}
],
"_prefab": null,
...
...
@@ -3664,12 +3664,15 @@
"_children": [
{
"__id__": 79
},
{
"__id__": 81
}
],
"_active": true,
"_components": [
{
"__id__": 8
1
"__id__": 8
3
}
],
"_prefab": null,
...
...
@@ -3801,6 +3804,87 @@
"preload": false,
"_id": "47ldRFoVBIiIz8lx71RIrx"
},
{
"__type__": "cc.Node",
"_name": "Cartoon Short Version 2_01",
"_objFlags": 0,
"_parent": {
"__id__": 78
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 82
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 0,
"height": 0
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "66zfr5x/VBRLfVG8a4e/gn"
},
{
"__type__": "cc.AudioSource",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 81
},
"_enabled": true,
"_clip": {
"__uuid__": "4f4a1f56-3743-4d39-83a3-41c6314e6b4e"
},
"_volume": 0.5,
"_mute": false,
"_loop": true,
"_firstlyEnabled": true,
"playOnLoad": true,
"preload": false,
"_id": "1eeLLVdTNN+a9bjKTz51AH"
},
{
"__type__": "bccdbjIIvVBZoLltHmAttIC",
"_name": "",
...
...
assets/resources/sound/Cartoon Short Version 2_01.ogg
0 → 100644
View file @
01f0c342
File added
assets/scripts/GamePlay/HuController.ts
View file @
01f0c342
...
...
@@ -25,19 +25,23 @@ export default class HuController extends cc.Component {
this
.
node
.
on
(
cc
.
Node
.
EventType
.
TOUCH_MOVE
,
this
.
onTouchMove
,
this
)
this
.
spine
.
setCompleteListener
(()
=>
this
.
setRotateAnim
());
this
.
scheduleOnce
(()
=>
this
.
testDevice
,
3
);
this
.
scheduleOnce
(
this
.
testDevice
,
2
);
// this.scheduleOnce(() => {
// (window.DeviceMotionEvent as any).requestPermission()
// .then(response => {
// this.text.string = (response);
// this.testDevice();
// }
// )
// }, 2);
}
private
testDevice
()
{
this
.
text
.
string
=
'testDevice'
;
console
.
log
(
'testDevice'
,)
window
.
addEventListener
(
"devicemotion"
,
(
event
)
=>
{
if
(
!
event
.
accelerationIncludingGravity
)
{
return
;
}
this
.
text
.
string
=
`lac`
;
this
.
text
.
string
=
'device motion'
;
const
x
=
event
.
accelerationIncludingGravity
.
x
;
const
y
=
event
.
accelerationIncludingGravity
.
y
;
...
...
@@ -57,8 +61,9 @@ export default class HuController extends cc.Component {
if
(
this
.
_count
>
0
)
{
this
.
scheduleOnce
(()
=>
{
this
.
text
.
string
=
`lac `
+
this
.
_count
;
this
.
_count
=
0
;
},
1.5
)
},
2
)
}
if
(
this
.
_count
>
5
)
{
...
...
@@ -84,7 +89,7 @@ export default class HuController extends cc.Component {
}
private
onTouchStart
(
event
:
cc
.
Event
.
EventTouch
):
void
{
console
.
log
(
'onTouchStart'
,
)
console
.
log
(
'onTouchStart'
,)
if
(
!
this
.
_pointStart
)
{
this
.
setRotateAnim
();
}
...
...
assets/scripts/UI/ActionScreen.ts
View file @
01f0c342
...
...
@@ -11,13 +11,15 @@ export default class ActionScreen extends cc.Component {
private
bottleAction
:
cc
.
Node
=
null
;
private
_buaController
:
BuaController
=
null
;
private
_spine
:
sp
.
Skeleton
=
null
;
onLoad
()
{
eventTarget
.
on
(
SHOW_ACTION_SCREEN
,
this
.
showScreen
,
this
);
eventTarget
.
on
(
SHOW_START_SCREEN
,
this
.
hideScreen
,
this
);
eventTarget
.
on
(
SHOW_ACTION_SCREEN
,
this
.
showScreen
,
this
);
eventTarget
.
on
(
SHOW_START_SCREEN
,
this
.
hideScreen
,
this
);
eventTarget
.
on
(
PLAY_ANIM_NUT1
,
this
.
hideBottle
,
this
);
this
.
_buaController
=
this
.
getComponentInChildren
(
BuaController
);
// this.node.active = false;
this
.
_spine
=
this
.
bottleIdle
.
getComponent
(
sp
.
Skeleton
);
}
private
hideBottle
()
{
...
...
@@ -28,6 +30,7 @@ export default class ActionScreen extends cc.Component {
private
showScreen
()
{
this
.
bottleAction
.
active
=
false
;
this
.
bottleIdle
.
active
=
true
;
this
.
_spine
.
setAnimation
(
0
,
'Idle'
,
true
);
this
.
node
.
active
=
true
;
this
.
_buaController
.
onSetTool
();
...
...
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