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
878d9177
Commit
878d9177
authored
May 09, 2025
by
Vũ Gia Vương
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
done fix show slot
parent
89976061
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
50 additions
and
18 deletions
+50
-18
BottleBreakingScreen.prefab
assets/Prefabs/BottleBreakingScreen.prefab
+33
-9
Events.ts
assets/scripts/Events.ts
+2
-1
FragmentJarController.ts
assets/scripts/GamePlay/FragmentJarController.ts
+5
-6
SlotJar.ts
assets/scripts/GamePlay/SlotJar.ts
+10
-2
No files found.
assets/Prefabs/BottleBreakingScreen.prefab
View file @
878d9177
...
...
@@ -5223,7 +5223,9 @@
"__id__": 112
},
"_enabled": true,
"isBottom": false,
"slotJarIndex": [
0
],
"_id": ""
},
{
...
...
@@ -6663,7 +6665,9 @@
"__id__": 152
},
"_enabled": true,
"isBottom": false,
"slotJarIndex": [
2
],
"_id": ""
},
{
...
...
@@ -8113,7 +8117,10 @@
"__id__": 192
},
"_enabled": true,
"isBottom": false,
"slotJarIndex": [
0,
1
],
"_id": ""
},
{
...
...
@@ -9588,7 +9595,9 @@
"__id__": 232
},
"_enabled": true,
"isBottom": false,
"slotJarIndex": [
2
],
"_id": ""
},
{
...
...
@@ -11038,7 +11047,9 @@
"__id__": 272
},
"_enabled": true,
"isBottom": false,
"slotJarIndex": [
1
],
"_id": ""
},
{
...
...
@@ -12483,7 +12494,11 @@
"__id__": 312
},
"_enabled": true,
"isBottom": false,
"slotJarIndex": [
1,
2,
4
],
"_id": ""
},
{
...
...
@@ -13958,7 +13973,10 @@
"__id__": 352
},
"_enabled": true,
"isBottom": false,
"slotJarIndex": [
2,
4
],
"_id": ""
},
{
...
...
@@ -15428,7 +15446,10 @@
"__id__": 392
},
"_enabled": true,
"isBottom": false,
"slotJarIndex": [
3,
4
],
"_id": ""
},
{
...
...
@@ -16888,7 +16909,10 @@
"__id__": 432
},
"_enabled": true,
"isBottom": false,
"slotJarIndex": [
3,
4
],
"_id": ""
},
{
...
...
assets/scripts/Events.ts
View file @
878d9177
...
...
@@ -23,3 +23,4 @@ export const DROP_ALL_FRAGMENT = 'DROP_ALL_FRAGMENT';
export
const
DROP_TOP_FRAGMENT
=
'DROP_TOP_FRAGMENT'
;
export
const
SHAKE_FRAGMENT
=
'SHAKE_FRAGMENT'
;
export
const
SHOW_FOG
=
'SHOW_FOG'
;
export
const
SHOW_SLOT_JAR
=
'SHOW_SLOT_JAR'
;
\ No newline at end of file
assets/scripts/GamePlay/FragmentJarController.ts
View file @
878d9177
import
{
CHECK_FRAGMENT
,
CHECK_TOUCH
,
DROP_ALL_FRAGMENT
,
eventTarget
,
HAMMER
,
PLAY_DROP_SOUND
,
RESET_FRAGMENT
,
SHAKE_FRAGMENT
,
SHOW_FOG
}
from
"../Events"
;
import
{
CHECK_FRAGMENT
,
CHECK_TOUCH
,
DROP_ALL_FRAGMENT
,
eventTarget
,
HAMMER
,
PLAY_DROP_SOUND
,
RESET_FRAGMENT
,
SHAKE_FRAGMENT
,
SHOW_FOG
,
SHOW_SLOT_JAR
}
from
"../Events"
;
import
{
Global
}
from
"../Global"
;
import
SlotJar
from
"./SlotJar"
;
...
...
@@ -6,8 +6,8 @@ const { ccclass, property } = cc._decorator;
@
ccclass
export
default
class
FragmentJarController
extends
cc
.
Component
{
@
property
private
isBottom
:
boolean
=
false
;
@
property
([
Number
])
private
slotJarIndex
:
number
[]
=
[]
;
public
isDropped
:
boolean
=
false
;
...
...
@@ -55,7 +55,7 @@ export default class FragmentJarController extends cc.Component {
}
private
checkTouch
(
point
:
cc
.
Vec2
)
{
if
(
this
.
isDropped
||
this
.
isBottom
)
{
if
(
this
.
isDropped
)
{
return
;
}
const
jarPos
=
this
.
node
.
parent
.
position
;
...
...
@@ -71,8 +71,7 @@ export default class FragmentJarController extends cc.Component {
eventTarget
.
emit
(
HAMMER
,
point
);
this
.
_slotJar
.
showSlots
(
3
-
this
.
_numberOfBeats
);
eventTarget
.
emit
(
SHOW_SLOT_JAR
,
this
.
slotJarIndex
,
3
-
this
.
_numberOfBeats
);
if
(
this
.
_numberOfBeats
==
1
)
{
eventTarget
.
emit
(
SHOW_FOG
,
this
.
node
.
position
);
}
...
...
assets/scripts/GamePlay/SlotJar.ts
View file @
878d9177
import
{
eventTarget
,
RESET_BOTTLE
}
from
"../Events"
;
import
{
eventTarget
,
RESET_BOTTLE
,
SHOW_SLOT_JAR
}
from
"../Events"
;
const
{
ccclass
,
property
}
=
cc
.
_decorator
;
@
ccclass
export
default
class
SlotJar
extends
cc
.
Component
{
private
_slotBreak2thNodes
:
cc
.
Node
[]
=
[];
private
_slotBreak1thNodes
:
cc
.
Node
[]
=
[];
private
_slotShowder
:
{
[
key
:
number
]:
number
}
=
{};
protected
onLoad
():
void
{
this
.
_slotBreak1thNodes
=
this
.
node
.
children
;
...
...
@@ -14,6 +14,14 @@ export default class SlotJar extends cc.Component {
this
.
resetSlots
();
eventTarget
.
on
(
RESET_BOTTLE
,
this
.
resetSlots
,
this
);
eventTarget
.
on
(
SHOW_SLOT_JAR
,
this
.
showSlotByIndex
,
this
);
}
private
showSlotByIndex
(
indexs
:
number
[],
breakCount
:
number
):
void
{
indexs
.
forEach
(
index
=>
{
this
.
_slotBreak1thNodes
[
index
].
active
=
true
;
this
.
_slotBreak2thNodes
[
index
].
active
=
breakCount
>=
2
;
})
}
public
showSlots
(
breakCount
:
number
):
void
{
...
...
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