Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cc_mz_write_02
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
template admin
cc_mz_write_02
Commits
738a7fef
Commit
738a7fef
authored
Oct 24, 2022
by
limingzhe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:debug
parent
da8166ba
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
19 deletions
+30
-19
cc_mz_write_02.js
assets/cc_mz_write_02/scene/cc_mz_write_02.js
+30
-19
No files found.
assets/cc_mz_write_02/scene/cc_mz_write_02.js
View file @
738a7fef
...
...
@@ -587,15 +587,15 @@ cc.Class({
//
if (this.isCanDraw) {
//
return;
//
}
//
this.isCanDraw = true;
if
(
this
.
isCanDraw
)
{
return
;
}
this
.
isCanDraw
=
true
;
// delayCall(0.3
, () => {
//
this.isCanDraw = false;
//
})
delayCall
(
0.01
,
()
=>
{
this
.
isCanDraw
=
false
;
})
this
.
debugDrawLayer
.
removeAllChildren
();
...
...
@@ -1243,7 +1243,8 @@ cc.Class({
picNode
.
isRight
=
isRight
;
picNode
.
playRightAnim
();
// picNode.playRightAnim();
this
.
playRightAnim
(
picNode
);
if
(
!
this
.
isGameEnd
)
{
this
.
checkGameEnd
();
...
...
@@ -4468,6 +4469,7 @@ cc.Class({
setOneAnimaSmall
(
data
)
{
const
rate
=
(
this
.
hotZoneBg
.
scale
*
this
.
hotZoneBg
.
width
)
/
this
.
data
.
bgItem
.
rect
.
width
;
const
rectNode
=
new
cc
.
Node
();
...
...
@@ -4505,7 +4507,7 @@ cc.Class({
this
.
hotZoneBg
.
addChild
(
animaNode
);
animaNode
.
data
=
data
;
animaNode
.
hitCount
=
0
;
if
(
data
.
audio_url
)
{
cc
.
assetManager
.
loadRemote
(
data
.
audio_url
,
(
err
,
audioClip
)
=>
{
...
...
@@ -4548,18 +4550,19 @@ cc.Class({
armatureNames
.
push
(
armatures
[
i
].
name
);
}
// console.log('armatureNames: ', armatureNames);
let
animationNames
=
[];
if
(
armatureNames
.
length
>
0
)
{
let
defaultArmatureName
=
armatureNames
[
0
];
dragonDisplay
.
armatureName
=
defaultArmatureName
;
// let animationNames = dragonDisplay.getAnimationNames(defaultArmatureName);
let
defaultArmature
=
armatures
[
0
];
let
animations
=
defaultArmature
.
animation
;
let
animationNames
=
[];
for
(
let
i
=
0
;
i
<
animations
.
length
;
i
++
)
{
animationNames
.
push
(
animations
[
i
].
name
);
}
animaNode
.
animationNames
=
animationNames
;
rectNode
.
addComponent
(
cc
.
Button
);
rectNode
.
on
(
'
click
'
,
()
=>
{
if
(
rectNode
.
isClicked
)
{
...
...
@@ -4579,16 +4582,16 @@ cc.Class({
}
});
animaNode
.
playRightAnim
=
()
=>
{
animaNode
.
active
=
true
;
if
(
animationNames
.
length
>
0
)
{
dragonDisplay
.
playAnimation
(
animationNames
[
0
],
1
);
}
}
// animaNode.playRightAnim = () => {
// animaNode.active = true;
// if (animationNames.length > 0) {
// dragonDisplay.playAnimation(animationNames[0], 1);
// }
// }
animaNode
.
dragonDisplay
=
dragonDisplay
;
this
.
animaNodeArr
.
push
(
animaNode
);
}
this
.
animaNodeArr
.
push
(
animaNode
);
animaNode
.
x
=
rectNode
.
x
+
rectNode
.
width
/
2
;
animaNode
.
y
=
rectNode
.
y
+
rectNode
.
height
/
2
;
...
...
@@ -4608,7 +4611,15 @@ cc.Class({
},
playRightAnim
(
animaNode
)
{
const
animationNames
=
animaNode
.
animationNames
;
const
dragonDisplay
=
animaNode
.
dragonDisplay
;
animaNode
.
active
=
true
;
if
(
dragonDisplay
&&
animationNames
&&
animationNames
.
length
>
0
)
{
dragonDisplay
.
playAnimation
(
animationNames
[
0
],
1
);
}
},
setOneHotZonePic
(
data
)
{
const
rate
=
(
this
.
hotZoneBg
.
scale
*
this
.
hotZoneBg
.
width
)
/
this
.
data
.
bgItem
.
rect
.
width
;
...
...
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