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
5ed973cb
Commit
5ed973cb
authored
Apr 02, 2025
by
Vũ Gia Vương
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add RESET_FRAGMENT
parent
f4eee2d3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
6 deletions
+8
-6
Events.ts
assets/scripts/Events.ts
+2
-1
BreakingBottleController.ts
assets/scripts/GamePlay/BreakingBottleController.ts
+4
-4
FragmentController.ts
assets/scripts/GamePlay/FragmentController.ts
+2
-1
No files found.
assets/scripts/Events.ts
View file @
5ed973cb
...
@@ -24,4 +24,5 @@ export const STOP_GUILD_TAP = 'STOP_GUILD_TAP';
...
@@ -24,4 +24,5 @@ export const STOP_GUILD_TAP = 'STOP_GUILD_TAP';
export
const
CHECK_TOUCH
=
'CHECK_TOUCH'
;
export
const
CHECK_TOUCH
=
'CHECK_TOUCH'
;
export
const
CHECK_FRAGMENT
=
'CHECK_FRAGMENT'
;
export
const
CHECK_FRAGMENT
=
'CHECK_FRAGMENT'
;
export
const
HAMMER
=
'HAMMER'
;
export
const
HAMMER
=
'HAMMER'
;
export
const
RESET_BOTTLE
=
'RESET_BOTTLE'
;
export
const
RESET_BOTTLE
=
'RESET_BOTTLE'
;
\ No newline at end of file
export
const
RESET_FRAGMENT
=
'RESET_FRAGMENT'
;
\ No newline at end of file
assets/scripts/GamePlay/BreakingBottleController.ts
View file @
5ed973cb
import
{
CHECK_FRAGMENT
,
CHECK_TOUCH
,
eventTarget
,
HAMMER
,
RESET_BOTTLE
,
SHOW_CARD_POPUP
}
from
"../Events"
;
import
{
CHECK_FRAGMENT
,
CHECK_TOUCH
,
eventTarget
,
HAMMER
,
RESET_BOTTLE
,
RESET_FRAGMENT
,
SHOW_CARD_POPUP
}
from
"../Events"
;
import
{
Global
}
from
"../Global"
;
import
{
Global
}
from
"../Global"
;
import
FragmentController
from
"./FragmentController"
;
import
FragmentController
from
"./FragmentController"
;
import
TheController
from
"./TheController"
;
import
TheController
from
"./TheController"
;
...
@@ -47,10 +47,10 @@ export default class BreakingBottleController extends cc.Component {
...
@@ -47,10 +47,10 @@ export default class BreakingBottleController extends cc.Component {
this
.
_spine
.
setSkin
(
this
.
_skins
[
Global
.
tool
%
this
.
_skins
.
length
]);
this
.
_spine
.
setSkin
(
this
.
_skins
[
Global
.
tool
%
this
.
_skins
.
length
]);
this
.
_spine
.
setAnimation
(
0
,
"Dap4"
,
false
);
this
.
_spine
.
setAnimation
(
0
,
"Dap4"
,
false
);
this
.
_fragmentsNode
.
forEach
((
item
,
index
)
=>
{
this
.
_fragmentsNode
.
forEach
((
node
,
index
)
=>
{
item
.
position
=
this
.
_fragmentsPosition
[
index
];
node
.
position
=
this
.
_fragmentsPosition
[
index
];
item
.
getComponent
(
FragmentController
).
reset
();
})
})
eventTarget
.
emit
(
RESET_FRAGMENT
);
}
}
private
onHammer
(
newPos
:
cc
.
Vec2
)
{
private
onHammer
(
newPos
:
cc
.
Vec2
)
{
...
...
assets/scripts/GamePlay/FragmentController.ts
View file @
5ed973cb
import
{
eventTarget
,
CHECK_TOUCH
,
CHECK_FRAGMENT
,
HAMMER
}
from
"../Events"
;
import
{
eventTarget
,
CHECK_TOUCH
,
CHECK_FRAGMENT
,
HAMMER
,
RESET_FRAGMENT
}
from
"../Events"
;
const
{
ccclass
,
property
}
=
cc
.
_decorator
;
const
{
ccclass
,
property
}
=
cc
.
_decorator
;
...
@@ -20,6 +20,7 @@ export default class FragmentController extends cc.Component {
...
@@ -20,6 +20,7 @@ export default class FragmentController extends cc.Component {
this
.
reset
();
this
.
reset
();
eventTarget
.
on
(
CHECK_TOUCH
,
this
.
checkTouch
,
this
);
eventTarget
.
on
(
CHECK_TOUCH
,
this
.
checkTouch
,
this
);
eventTarget
.
on
(
RESET_FRAGMENT
,
this
.
reset
,
this
);
}
}
public
reset
()
{
public
reset
()
{
...
...
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