Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
MingSnake_241120
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
SparkProjects
MingSnake_241120
Commits
ac391f38
Commit
ac391f38
authored
Nov 27, 2024
by
haiyoucuv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
init
parent
a4cdb39c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
22 deletions
+31
-22
MainGame.scene
assets/Bundles/MainGame/MainGame.scene
+6
-2
PropBtn.ts
assets/Scripts/Scenes/MainGame/Components/PropBtn.ts
+1
-6
Target.ts
assets/Scripts/Scenes/MainGame/Components/Target.ts
+24
-14
No files found.
assets/Bundles/MainGame/MainGame.scene
View file @
ac391f38
...
...
@@ -6041,8 +6041,12 @@
"graphics": {
"__id__": 155
},
"cdTxt": null,
"goalTxt": null,
"cdTxt": {
"__id__": 144
},
"goalTxt": {
"__id__": 158
},
"_id": "dfl2fX641H3qOpggystLiY"
},
{
...
...
assets/Scripts/Scenes/MainGame/Components/PropBtn.ts
View file @
ac391f38
...
...
@@ -14,7 +14,6 @@ export class PropBtn extends Component {
cdTxt
:
Label
;
onLoad
()
{
this
.
img
=
this
.
node
.
getChildByName
(
"img"
).
getComponent
(
Sprite
);
this
.
nameTxt
=
this
.
node
.
getChildByName
(
"name"
).
getComponent
(
Label
);
...
...
@@ -46,8 +45,7 @@ export class PropBtn extends Component {
startCd
(
cd
=
5
)
{
this
.
cdTxt
.
node
.
active
=
true
;
this
.
cdMask
.
node
.
active
=
true
;
this
.
totalCd
=
cd
;
this
.
cd
=
cd
;
this
.
cd
=
this
.
totalCd
=
cd
;
tween
(
this
as
PropBtn
)
.
to
(
cd
,
{
cd
:
0
},
{
onUpdate
:
(
target
:
PropBtn
,
ratio
:
number
)
=>
{
...
...
@@ -66,9 +64,6 @@ export class PropBtn extends Component {
}
update
(
deltaTime
:
number
)
{
}
}
assets/Scripts/Scenes/MainGame/Components/Target.ts
View file @
ac391f38
import
{
_decorator
,
Component
,
Graphics
,
Label
,
math
,
misc
,
Node
}
from
"cc"
;
import
{
_decorator
,
Component
,
Graphics
,
Label
,
math
,
misc
,
Node
,
tween
}
from
"cc"
;
const
{
ccclass
,
property
,
executeInEditMode
}
=
_decorator
;
...
...
@@ -13,18 +13,31 @@ export class Target extends Component {
@
property
(
Label
)
goalTxt
:
Label
=
null
;
start
()
{
// this.graphics.clear();
// this.graphics.moveTo(120, 0);
// this.graphics.lineTo(120, -51);
// this.graphics.arc(110, -51, 10, 0, -Math.PI / 2, false);
// this.graphics.lineTo(-110, -61);
// this.graphics.arc(-110, -51, 10, -Math.PI / 2, -Math.PI, false);
// this.graphics.lineTo(-120, 0);
// this.graphics.stroke();
this
.
drawProcess
(
0.5
);
this
.
startCd
(
10
);
}
totalCd
=
0
;
cd
=
0
;
startCd
(
cd
=
5
)
{
this
.
graphics
.
node
.
active
=
true
;
this
.
cd
=
this
.
totalCd
=
cd
;
tween
(
this
as
Target
)
.
to
(
cd
,
{
cd
:
0
},
{
onUpdate
:
(
target
:
Target
,
ratio
:
number
)
=>
{
this
.
drawProcess
(
1
-
ratio
);
this
.
cdTxt
.
string
=
`
${
~~
this
.
cd
}
`
;
},
onComplete
:
()
=>
{
this
.
cdTxt
.
string
=
`0`
;
this
.
graphics
.
node
.
active
=
false
;
}
})
.
start
();
}
drawProcess
=
(()
=>
{
const
phases
=
[
51
,
...
...
@@ -105,7 +118,4 @@ export class Target extends Component {
};
})();
update
(
deltaTime
:
number
)
{
}
}
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