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
d3dc4b79
Commit
d3dc4b79
authored
Apr 02, 2025
by
Vũ Gia Vương
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix auto hammer
parent
8900601a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
11 deletions
+6
-11
BreakingBottleController.ts
assets/scripts/GamePlay/BreakingBottleController.ts
+6
-11
No files found.
assets/scripts/GamePlay/BreakingBottleController.ts
View file @
d3dc4b79
...
@@ -45,13 +45,12 @@ export default class BreakingBottleController extends cc.Component {
...
@@ -45,13 +45,12 @@ export default class BreakingBottleController extends cc.Component {
}
}
protected
start
():
void
{
protected
start
():
void
{
this
.
hide
Hammer
();
this
.
reset
Hammer
();
}
}
private
resetBottle
()
{
private
resetBottle
()
{
this
.
_countFragment
=
0
;
this
.
_countFragment
=
0
;
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
.
_fragmentsNode
.
forEach
((
node
,
index
)
=>
{
this
.
_fragmentsNode
.
forEach
((
node
,
index
)
=>
{
node
.
position
=
this
.
_fragmentsPosition
[
index
];
node
.
position
=
this
.
_fragmentsPosition
[
index
];
...
@@ -60,14 +59,14 @@ export default class BreakingBottleController extends cc.Component {
...
@@ -60,14 +59,14 @@ export default class BreakingBottleController extends cc.Component {
}
}
private
onHammer
(
newPos
:
cc
.
Vec2
)
{
private
onHammer
(
newPos
:
cc
.
Vec2
)
{
this
.
hammerNode
.
active
=
false
;
this
.
scheduleOnce
(()
=>
this
.
hammerNode
.
active
=
true
,
0
);
cc
.
Tween
.
stopAllByTarget
(
this
.
hammerNode
);
cc
.
Tween
.
stopAllByTarget
(
this
.
hammerNode
);
this
.
_spine
.
setAnimation
(
0
,
"Dap4"
,
false
);
this
.
_spine
.
setAnimation
(
0
,
"Dap4"
,
false
);
cc
.
tween
(
this
.
hammerNode
)
cc
.
tween
(
this
.
hammerNode
)
.
to
(
0
,
{
opacity
:
255
,
position
:
cc
.
v3
(
newPos
.
x
,
newPos
.
y
,
0
),
active
:
false
})
.
to
(
0
,
{
active
:
false
})
.
to
(
0
,
{
active
:
true
})
.
to
(
0
,
{
position
:
cc
.
v3
(
newPos
.
x
,
newPos
.
y
,
0
),
active
:
false
})
.
to
(
0
,
{
active
:
true
})
.
to
(
0
,
{
active
:
true
})
.
delay
(
1
)
.
delay
(
1
)
.
to
(
0.5
,
{
position
:
cc
.
v3
(
300
)
})
.
to
(
0.5
,
{
position
:
cc
.
v3
(
300
)
})
...
@@ -87,18 +86,14 @@ export default class BreakingBottleController extends cc.Component {
...
@@ -87,18 +86,14 @@ export default class BreakingBottleController extends cc.Component {
const
nodePos
=
this
.
node
.
convertToNodeSpaceAR
(
pos
);
const
nodePos
=
this
.
node
.
convertToNodeSpaceAR
(
pos
);
eventTarget
.
emit
(
CHECK_TOUCH
,
nodePos
);
eventTarget
.
emit
(
CHECK_TOUCH
,
nodePos
);
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
);
}
}
private
onTouchEnd
(
event
:
cc
.
Event
.
EventTouch
)
{
private
onTouchEnd
(
event
:
cc
.
Event
.
EventTouch
)
{
}
}
private
hideHammer
()
{
private
resetHammer
()
{
// this.hammerNode.opacity = 0;
this
.
hammerNode
.
position
=
cc
.
v3
(
300
);
this
.
hammerNode
.
position
=
cc
.
v3
(
300
);
}
}
...
...
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