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
21489ab8
Commit
21489ab8
authored
Apr 01, 2025
by
Vũ Gia Vương
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add dynamic rigibody
parent
6afb5718
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
921 additions
and
71 deletions
+921
-71
main.fire
assets/main.fire
+897
-67
FragmentController.ts
assets/scripts/GamePlay/FragmentController.ts
+22
-4
BreakingBottleScreen.ts
assets/scripts/UI/BreakingBottleScreen.ts
+2
-0
No files found.
assets/main.fire
View file @
21489ab8
...
...
@@ -99,10 +99,10 @@
"_active": true,
"_components": [
{
"__id__": 1
54
"__id__": 1
76
},
{
"__id__": 1
55
"__id__": 1
77
}
],
"_prefab": null,
...
...
@@ -5137,13 +5137,19 @@
"__id__": 115
},
{
"__id__": 151
"__id__": 167
},
{
"__id__": 169
},
{
"__id__": 172
}
],
"_active": true,
"_components": [
{
"__id__": 1
53
"__id__": 1
75
}
],
"_prefab": null,
...
...
@@ -5332,8 +5338,8 @@
0,
0,
1,
1
,
1
,
2
,
2
,
1
]
},
...
...
@@ -5394,13 +5400,13 @@
"__id__": 116
},
{
"__id__": 1
41
"__id__": 1
53
}
],
"_active": true,
"_components": [
{
"__id__": 1
50
"__id__": 1
66
}
],
"_prefab": null,
...
...
@@ -5463,19 +5469,19 @@
"__id__": 117
},
{
"__id__": 12
1
"__id__": 12
3
},
{
"__id__": 12
5
"__id__": 12
9
},
{
"__id__": 1
29
"__id__": 1
35
},
{
"__id__": 1
33
"__id__": 1
41
},
{
"__id__": 1
3
7
"__id__": 1
4
7
}
],
"_active": true,
...
...
@@ -5546,6 +5552,12 @@
},
{
"__id__": 120
},
{
"__id__": 121
},
{
"__id__": 122
}
],
"_prefab": null,
...
...
@@ -5706,6 +5718,74 @@
],
"_id": "6f0VIVDhBLPqmSJl7BabDB"
},
{
"__type__": "cc.RigidBody",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 117
},
"_enabled": true,
"_type": 1,
"_allowSleep": true,
"_gravityScale": 1,
"_linearDamping": 0,
"_angularDamping": 0,
"_linearVelocity": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_angularVelocity": 0,
"_fixedRotation": false,
"enabledContactListener": false,
"bullet": false,
"awakeOnLoad": true,
"_id": "96E//LaSJPzq0bcVXbyPHa"
},
{
"__type__": "cc.PhysicsPolygonCollider",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 117
},
"_enabled": true,
"tag": 0,
"_density": 1,
"_sensor": false,
"_friction": 0.2,
"_restitution": 0,
"body": null,
"_offset": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"points": [
{
"__type__": "cc.Vec2",
"x": -50,
"y": -50
},
{
"__type__": "cc.Vec2",
"x": 50,
"y": -50
},
{
"__type__": "cc.Vec2",
"x": 50,
"y": 50
},
{
"__type__": "cc.Vec2",
"x": -50,
"y": 50
}
],
"_id": "b36C/DBhlBQLDzkuU3At3u"
},
{
"__type__": "cc.Node",
"_name": "3",
...
...
@@ -5717,13 +5797,19 @@
"_active": true,
"_components": [
{
"__id__": 12
2
"__id__": 12
4
},
{
"__id__": 12
3
"__id__": 12
5
},
{
"__id__": 124
"__id__": 126
},
{
"__id__": 127
},
{
"__id__": 128
}
],
"_prefab": null,
...
...
@@ -5779,7 +5865,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 12
1
"__id__": 12
3
},
"_enabled": true,
"_materials": [
...
...
@@ -5811,7 +5897,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 12
1
"__id__": 12
3
},
"_enabled": true,
"_id": "4f6Dt6/09FwL+yIiIkzOdP"
...
...
@@ -5821,7 +5907,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 12
1
"__id__": 12
3
},
"_enabled": true,
"tag": 0,
...
...
@@ -5914,6 +6000,74 @@
],
"_id": "48m94JTnZJF49No8VUxTS4"
},
{
"__type__": "cc.RigidBody",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 123
},
"_enabled": true,
"_type": 1,
"_allowSleep": true,
"_gravityScale": 1,
"_linearDamping": 0,
"_angularDamping": 0,
"_linearVelocity": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_angularVelocity": 0,
"_fixedRotation": false,
"enabledContactListener": false,
"bullet": false,
"awakeOnLoad": true,
"_id": "1cVmJ6N0hL5oSO/Xyubr+8"
},
{
"__type__": "cc.PhysicsPolygonCollider",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 123
},
"_enabled": true,
"tag": 0,
"_density": 1,
"_sensor": false,
"_friction": 0.2,
"_restitution": 0,
"body": null,
"_offset": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"points": [
{
"__type__": "cc.Vec2",
"x": -50,
"y": -50
},
{
"__type__": "cc.Vec2",
"x": 50,
"y": -50
},
{
"__type__": "cc.Vec2",
"x": 50,
"y": 50
},
{
"__type__": "cc.Vec2",
"x": -50,
"y": 50
}
],
"_id": "08gVRCek9B8rCMCwhP1IMO"
},
{
"__type__": "cc.Node",
"_name": "2",
...
...
@@ -5925,13 +6079,19 @@
"_active": true,
"_components": [
{
"__id__": 1
26
"__id__": 1
30
},
{
"__id__": 1
27
"__id__": 1
31
},
{
"__id__": 128
"__id__": 132
},
{
"__id__": 133
},
{
"__id__": 134
}
],
"_prefab": null,
...
...
@@ -5987,7 +6147,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 12
5
"__id__": 12
9
},
"_enabled": true,
"_materials": [
...
...
@@ -6019,7 +6179,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 12
5
"__id__": 12
9
},
"_enabled": true,
"_id": "63ZB/kFSVEKavLaqo0Hp3l"
...
...
@@ -6029,7 +6189,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 12
5
"__id__": 12
9
},
"_enabled": true,
"tag": 0,
...
...
@@ -6127,6 +6287,74 @@
],
"_id": "e7WUlmxT9KzJisRzEoQeZB"
},
{
"__type__": "cc.RigidBody",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 129
},
"_enabled": true,
"_type": 1,
"_allowSleep": true,
"_gravityScale": 1,
"_linearDamping": 0,
"_angularDamping": 0,
"_linearVelocity": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_angularVelocity": 0,
"_fixedRotation": false,
"enabledContactListener": false,
"bullet": false,
"awakeOnLoad": true,
"_id": "e7/g+MmHZGi6OdVGJ05XFO"
},
{
"__type__": "cc.PhysicsPolygonCollider",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 129
},
"_enabled": true,
"tag": 0,
"_density": 1,
"_sensor": false,
"_friction": 0.2,
"_restitution": 0,
"body": null,
"_offset": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"points": [
{
"__type__": "cc.Vec2",
"x": -50,
"y": -50
},
{
"__type__": "cc.Vec2",
"x": 50,
"y": -50
},
{
"__type__": "cc.Vec2",
"x": 50,
"y": 50
},
{
"__type__": "cc.Vec2",
"x": -50,
"y": 50
}
],
"_id": "4fg7Y47ARP4oJ+dica//Aj"
},
{
"__type__": "cc.Node",
"_name": "4",
...
...
@@ -6138,13 +6366,19 @@
"_active": true,
"_components": [
{
"__id__": 13
0
"__id__": 13
6
},
{
"__id__": 13
1
"__id__": 13
7
},
{
"__id__": 132
"__id__": 138
},
{
"__id__": 139
},
{
"__id__": 140
}
],
"_prefab": null,
...
...
@@ -6200,7 +6434,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
29
"__id__": 1
35
},
"_enabled": true,
"_materials": [
...
...
@@ -6232,7 +6466,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
29
"__id__": 1
35
},
"_enabled": true,
"_id": "21oKTWFXpPAbnbcJMb9BD0"
...
...
@@ -6242,7 +6476,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
29
"__id__": 1
35
},
"_enabled": true,
"tag": 0,
...
...
@@ -6360,6 +6594,74 @@
],
"_id": "38U9N/iIdDjZC1BSqUyuOR"
},
{
"__type__": "cc.RigidBody",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 135
},
"_enabled": true,
"_type": 1,
"_allowSleep": true,
"_gravityScale": 1,
"_linearDamping": 0,
"_angularDamping": 0,
"_linearVelocity": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_angularVelocity": 0,
"_fixedRotation": false,
"enabledContactListener": false,
"bullet": false,
"awakeOnLoad": true,
"_id": "9bjScVZJVKRr+2NYNxO7bS"
},
{
"__type__": "cc.PhysicsPolygonCollider",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 135
},
"_enabled": true,
"tag": 0,
"_density": 1,
"_sensor": false,
"_friction": 0.2,
"_restitution": 0,
"body": null,
"_offset": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"points": [
{
"__type__": "cc.Vec2",
"x": -50,
"y": -50
},
{
"__type__": "cc.Vec2",
"x": 50,
"y": -50
},
{
"__type__": "cc.Vec2",
"x": 50,
"y": 50
},
{
"__type__": "cc.Vec2",
"x": -50,
"y": 50
}
],
"_id": "c42FEkaTFP+L34R+90vfQg"
},
{
"__type__": "cc.Node",
"_name": "1",
...
...
@@ -6371,13 +6673,19 @@
"_active": true,
"_components": [
{
"__id__": 1
34
"__id__": 1
42
},
{
"__id__": 1
35
"__id__": 1
43
},
{
"__id__": 136
"__id__": 144
},
{
"__id__": 145
},
{
"__id__": 146
}
],
"_prefab": null,
...
...
@@ -6433,7 +6741,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
33
"__id__": 1
41
},
"_enabled": true,
"_materials": [
...
...
@@ -6465,7 +6773,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
33
"__id__": 1
41
},
"_enabled": true,
"tag": 0,
...
...
@@ -6568,29 +6876,103 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
33
"__id__": 1
41
},
"_enabled": true,
"_id": "bcmluUpTRPK6hZlUXAbqw5"
},
{
"__type__": "cc.
Node
",
"_name": "
5
",
"__type__": "cc.
RigidBody
",
"_name": "",
"_objFlags": 0,
"
_parent
": {
"__id__": 1
16
"
node
": {
"__id__": 1
41
},
"_children": [],
"_enabled": true,
"_type": 1,
"_allowSleep": true,
"_gravityScale": 1,
"_linearDamping": 0,
"_angularDamping": 0,
"_linearVelocity": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_angularVelocity": 0,
"_fixedRotation": false,
"enabledContactListener": false,
"bullet": false,
"awakeOnLoad": true,
"_id": "268Mde9LBJB6L90gfE520X"
},
{
"__type__": "cc.PhysicsPolygonCollider",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 141
},
"_enabled": true,
"tag": 0,
"_density": 1,
"_sensor": false,
"_friction": 0.2,
"_restitution": 0,
"body": null,
"_offset": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"points": [
{
"__type__": "cc.Vec2",
"x": -50,
"y": -50
},
{
"__type__": "cc.Vec2",
"x": 50,
"y": -50
},
{
"__type__": "cc.Vec2",
"x": 50,
"y": 50
},
{
"__type__": "cc.Vec2",
"x": -50,
"y": 50
}
],
"_id": "598g5pOPpBDIZKalrZYocI"
},
{
"__type__": "cc.Node",
"_name": "5",
"_objFlags": 0,
"_parent": {
"__id__": 116
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 1
3
8
"__id__": 1
4
8
},
{
"__id__": 1
3
9
"__id__": 1
4
9
},
{
"__id__": 140
"__id__": 150
},
{
"__id__": 151
},
{
"__id__": 152
}
],
"_prefab": null,
...
...
@@ -6646,7 +7028,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
3
7
"__id__": 1
4
7
},
"_enabled": true,
"_id": "68uH5Wy0NHeJJxTq87yA/F"
...
...
@@ -6656,7 +7038,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
3
7
"__id__": 1
4
7
},
"_enabled": true,
"_materials": [
...
...
@@ -6688,7 +7070,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
3
7
"__id__": 1
4
7
},
"_enabled": true,
"tag": 0,
...
...
@@ -6791,6 +7173,74 @@
],
"_id": "57w0vFMsFD4J0JpX3pJOXf"
},
{
"__type__": "cc.RigidBody",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 147
},
"_enabled": true,
"_type": 1,
"_allowSleep": true,
"_gravityScale": 1,
"_linearDamping": 0,
"_angularDamping": 0,
"_linearVelocity": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_angularVelocity": 0,
"_fixedRotation": false,
"enabledContactListener": false,
"bullet": false,
"awakeOnLoad": true,
"_id": "f7ROoVqV9KlKaVlbxU9ZIC"
},
{
"__type__": "cc.PhysicsPolygonCollider",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 147
},
"_enabled": true,
"tag": 0,
"_density": 1,
"_sensor": false,
"_friction": 0.2,
"_restitution": 0,
"body": null,
"_offset": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"points": [
{
"__type__": "cc.Vec2",
"x": -50,
"y": -50
},
{
"__type__": "cc.Vec2",
"x": 50,
"y": -50
},
{
"__type__": "cc.Vec2",
"x": 50,
"y": 50
},
{
"__type__": "cc.Vec2",
"x": -50,
"y": 50
}
],
"_id": "570aRhtbdMQJCjRfbfs9Y4"
},
{
"__type__": "cc.Node",
"_name": "Nap",
...
...
@@ -6800,10 +7250,10 @@
},
"_children": [
{
"__id__": 1
42
"__id__": 1
54
},
{
"__id__": 1
46
"__id__": 1
60
}
],
"_active": true,
...
...
@@ -6861,19 +7311,25 @@
"_name": "nap 2",
"_objFlags": 0,
"_parent": {
"__id__": 1
41
"__id__": 1
53
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 1
43
"__id__": 1
55
},
{
"__id__": 1
44
"__id__": 1
56
},
{
"__id__": 145
"__id__": 157
},
{
"__id__": 158
},
{
"__id__": 159
}
],
"_prefab": null,
...
...
@@ -6929,7 +7385,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
42
"__id__": 1
54
},
"_enabled": true,
"_materials": [
...
...
@@ -6961,7 +7417,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
42
"__id__": 1
54
},
"_enabled": true,
"tag": 0,
...
...
@@ -7109,29 +7565,103 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
42
"__id__": 1
54
},
"_enabled": true,
"_id": "66j+VkXfpNoadfW56880/G"
},
{
"__type__": "cc.RigidBody",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 154
},
"_enabled": true,
"_type": 1,
"_allowSleep": true,
"_gravityScale": 1,
"_linearDamping": 0,
"_angularDamping": 0,
"_linearVelocity": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_angularVelocity": 0,
"_fixedRotation": false,
"enabledContactListener": false,
"bullet": false,
"awakeOnLoad": true,
"_id": "2a5ou60eFOHZzJUy0H2vzY"
},
{
"__type__": "cc.PhysicsPolygonCollider",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 154
},
"_enabled": true,
"tag": 0,
"_density": 1,
"_sensor": false,
"_friction": 0.2,
"_restitution": 0,
"body": null,
"_offset": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"points": [
{
"__type__": "cc.Vec2",
"x": -50,
"y": -50
},
{
"__type__": "cc.Vec2",
"x": 50,
"y": -50
},
{
"__type__": "cc.Vec2",
"x": 50,
"y": 50
},
{
"__type__": "cc.Vec2",
"x": -50,
"y": 50
}
],
"_id": "2aeHK1109Lxp0IqDzRBAp5"
},
{
"__type__": "cc.Node",
"_name": "nap 1",
"_objFlags": 0,
"_parent": {
"__id__": 1
41
"__id__": 1
53
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 1
47
"__id__": 1
61
},
{
"__id__": 1
48
"__id__": 1
62
},
{
"__id__": 149
"__id__": 163
},
{
"__id__": 164
},
{
"__id__": 165
}
],
"_prefab": null,
...
...
@@ -7187,7 +7717,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
46
"__id__": 1
60
},
"_enabled": true,
"_materials": [
...
...
@@ -7219,7 +7749,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
46
"__id__": 1
60
},
"_enabled": true,
"_id": "24D4XJuZlE+q6fQu9Zy6vU"
...
...
@@ -7229,7 +7759,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
46
"__id__": 1
60
},
"_enabled": true,
"tag": 0,
...
...
@@ -7332,6 +7862,74 @@
],
"_id": "6dEWSFV2lAjZRMc+hEi4Uv"
},
{
"__type__": "cc.RigidBody",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 160
},
"_enabled": true,
"_type": 1,
"_allowSleep": true,
"_gravityScale": 1,
"_linearDamping": 0,
"_angularDamping": 0,
"_linearVelocity": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_angularVelocity": 0,
"_fixedRotation": false,
"enabledContactListener": false,
"bullet": false,
"awakeOnLoad": true,
"_id": "40GcwtmrhEuKRiuWWjVXMv"
},
{
"__type__": "cc.PhysicsPolygonCollider",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 160
},
"_enabled": true,
"tag": 0,
"_density": 1,
"_sensor": false,
"_friction": 0.2,
"_restitution": 0,
"body": null,
"_offset": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"points": [
{
"__type__": "cc.Vec2",
"x": -50,
"y": -50
},
{
"__type__": "cc.Vec2",
"x": 50,
"y": -50
},
{
"__type__": "cc.Vec2",
"x": 50,
"y": 50
},
{
"__type__": "cc.Vec2",
"x": -50,
"y": 50
}
],
"_id": "b2Sk5SfGZJko4XQX7dgETM"
},
{
"__type__": "6fcd79x0JdPZKDzUr010UMy",
"_name": "",
...
...
@@ -7353,7 +7951,7 @@
"_active": true,
"_components": [
{
"__id__": 1
52
"__id__": 1
68
}
],
"_prefab": null,
...
...
@@ -7409,7 +8007,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
51
"__id__": 1
67
},
"_enabled": true,
"_materials": [
...
...
@@ -7436,6 +8034,238 @@
"_atlas": null,
"_id": "4aeKl+F5NDy4t+ofdhiju2"
},
{
"__type__": "cc.Node",
"_name": "Ground",
"_objFlags": 0,
"_parent": {
"__id__": 110
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 170
},
{
"__id__": 171
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 2000,
"height": 100
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
-898.1,
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": "69sT2jMJ1Eo4eI0cKvUR7R"
},
{
"__type__": "cc.RigidBody",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 169
},
"_enabled": true,
"_type": 1,
"_allowSleep": true,
"_gravityScale": 1,
"_linearDamping": 0,
"_angularDamping": 0,
"_linearVelocity": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_angularVelocity": 0,
"_fixedRotation": false,
"enabledContactListener": false,
"bullet": false,
"awakeOnLoad": true,
"_id": "b9YodRnt9BtbHX8sfyUQpm"
},
{
"__type__": "cc.PhysicsBoxCollider",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 169
},
"_enabled": true,
"tag": 0,
"_density": 1,
"_sensor": false,
"_friction": 0.2,
"_restitution": 0,
"body": null,
"_offset": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_size": {
"__type__": "cc.Size",
"width": 2000,
"height": 100
},
"_id": "b8Mk8Eu8dBG4ECrSWuKcF2"
},
{
"__type__": "cc.Node",
"_name": "default_sprite_splash",
"_objFlags": 0,
"_parent": {
"__id__": 110
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 173
},
{
"__id__": 174
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 100,
"height": 100
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
3.01,
-526.727,
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": "a02Lxjqk9HJYVidyPlB44o"
},
{
"__type__": "cc.RigidBody",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 172
},
"_enabled": true,
"_type": 2,
"_allowSleep": true,
"_gravityScale": 1,
"_linearDamping": 0,
"_angularDamping": 0,
"_linearVelocity": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_angularVelocity": 0,
"_fixedRotation": false,
"enabledContactListener": false,
"bullet": false,
"awakeOnLoad": true,
"_id": "f1vILs+9dGzId9dSCs9quj"
},
{
"__type__": "cc.PhysicsBoxCollider",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 172
},
"_enabled": true,
"tag": 0,
"_density": 1,
"_sensor": false,
"_friction": 0.2,
"_restitution": 0,
"body": null,
"_offset": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_size": {
"__type__": "cc.Size",
"width": 100,
"height": 100
},
"_id": "55p7kNBX9GUKwcKmGcqJ9A"
},
{
"__type__": "90267gmddZPkLBW/eIiYJR6",
"_name": "",
...
...
@@ -7445,7 +8275,7 @@
},
"_enabled": true,
"spriteNode": {
"__id__": 1
51
"__id__": 1
67
},
"_id": "4eyUw4PwxKSq63DGUgJory"
},
...
...
assets/scripts/GamePlay/FragmentController.ts
View file @
21489ab8
...
...
@@ -7,22 +7,40 @@ const { ccclass, property } = cc._decorator;
export
default
class
FragmentController
extends
cc
.
Component
{
private
_collider
:
cc
.
PolygonCollider
=
null
;
private
_physicsCollider
:
cc
.
PhysicsPolygonCollider
=
null
;
private
_rg
:
cc
.
RigidBody
=
null
;
onLoad
()
{
this
.
_collider
=
this
.
node
.
getComponent
(
cc
.
PolygonCollider
);
console
.
log
(
'this._collider'
,
this
.
_collider
.
points
.
length
)
this
.
_physicsCollider
=
this
.
node
.
getComponent
(
cc
.
PhysicsPolygonCollider
);
this
.
_physicsCollider
.
points
=
this
.
_collider
.
points
;
this
.
_physicsCollider
.
enabled
=
false
;
this
.
_rg
=
this
.
node
.
getComponent
(
cc
.
RigidBody
);
eventTarget
.
on
(
CHECK_TOUCH
,
this
.
checkTouch
,
this
);
}
private
checkTouch
(
point
:
cc
.
Vec2
)
{
// console.log('point', point.toString(), this.node.position.toString());
const
pos
=
point
.
clone
().
subtract
(
cc
.
v2
(
this
.
node
.
position
.
x
,
this
.
node
.
position
.
y
));
let
isInside
=
cc
.
Intersection
.
pointInPolygon
(
pos
,
this
.
_collider
.
points
);
// console.log('this._collider.points', this._collider.points.map(i => i.toString()));
if
(
isInside
)
{
console
.
log
(
'isInside'
,
isInside
,
pos
.
toString
(),
this
.
node
.
name
)
this
.
dropFragment
();
}
}
private
dropFragment
()
{
const
pos
=
this
.
node
.
position
;
this
.
node
.
setSiblingIndex
(
-
1
);
cc
.
tween
(
this
.
node
)
.
to
(
0.2
,
{
scale
:
0.95
})
.
to
(
0.2
,
{
scale
:
1.05
,
position
:
pos
.
clone
().
multiplyScalar
(
1.2
)
})
.
call
(()
=>
{
this
.
_physicsCollider
.
enabled
=
true
;
this
.
_rg
.
type
=
cc
.
RigidBodyType
.
Dynamic
;
this
.
_rg
.
gravityScale
=
2
;
})
.
start
();
}
}
assets/scripts/UI/BreakingBottleScreen.ts
View file @
21489ab8
...
...
@@ -10,6 +10,8 @@ export default class BreakingBottleScreen extends cc.Component {
private
spriteNode
:
cc
.
Node
=
null
;
onLoad
()
{
cc
.
director
.
getPhysicsManager
().
enabled
=
true
;
this
.
node
.
position
=
cc
.
v3
(
0
,
0
);
this
.
node
.
on
(
cc
.
Node
.
EventType
.
TOUCH_START
,
this
.
onTouchStart
,
this
);
}
...
...
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