Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
Cocos-GoldenMiner
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
等吃饭
Cocos-GoldenMiner
Commits
9d1fbece
Commit
9d1fbece
authored
Apr 13, 2023
by
Friends233
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
暂存
parent
a9b742fc
Changes
23
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
550 additions
and
883 deletions
+550
-883
Game.fire
assets/Scenes/Game.fire
+177
-799
ClipAni.ts
assets/Script/ClipAni.ts
+0
-1
GameScene.ts
assets/Script/GameScene.ts
+9
-12
ImgFixedSize.ts
assets/Script/ImgFixedSize.ts
+36
-0
ImgFixedSize.ts.meta
assets/Script/ImgFixedSize.ts.meta
+10
-0
utils.ts
assets/Script/utils.ts
+5
-0
clipAni.anim
assets/resources/assets/ani/clipAni.anim
+60
-66
clipPlay.anim
assets/resources/assets/ani/clipPlay.anim
+2
-1
clipStop.anim
assets/resources/assets/ani/clipStop.anim
+2
-1
夹子待机_00000.png.meta
assets/resources/assets/images/clips/夹子待机_00000.png.meta
+3
-3
line.png
assets/resources/assets/images/line.png
+0
-0
line.png.meta
assets/resources/assets/images/line.png.meta
+38
-0
stop.meta
assets/resources/assets/images/stop.meta
+13
-0
夹子夹_00000.png
assets/resources/assets/images/stop/夹子夹_00000.png
+0
-0
夹子夹_00000.png.meta
assets/resources/assets/images/stop/夹子夹_00000.png.meta
+39
-0
夹子夹_00001.png
assets/resources/assets/images/stop/夹子夹_00001.png
+0
-0
夹子夹_00001.png.meta
assets/resources/assets/images/stop/夹子夹_00001.png.meta
+39
-0
夹子夹_00002.png
assets/resources/assets/images/stop/夹子夹_00002.png
+0
-0
夹子夹_00002.png.meta
assets/resources/assets/images/stop/夹子夹_00002.png.meta
+39
-0
夹子夹_00003.png
assets/resources/assets/images/stop/夹子夹_00003.png
+0
-0
夹子夹_00003.png.meta
assets/resources/assets/images/stop/夹子夹_00003.png.meta
+39
-0
夹子夹_00004.png
assets/resources/assets/images/stop/夹子夹_00004.png
+0
-0
夹子夹_00004.png.meta
assets/resources/assets/images/stop/夹子夹_00004.png.meta
+39
-0
No files found.
assets/Scenes/Game.fire
View file @
9d1fbece
This diff is collapsed.
Click to expand it.
assets/Script/ClipAni.ts
View file @
9d1fbece
...
...
@@ -18,7 +18,6 @@ export default class NewClass extends cc.Component {
state
}
cc
.
find
(
'Canvas'
).
dispatchEvent
(
this
.
event
)
console
.
log
(
cc
.
find
(
'Canvas'
))
}
start
()
{
this
.
event
=
new
cc
.
Event
.
EventCustom
(
"test"
,
true
)
...
...
assets/Script/GameScene.ts
View file @
9d1fbece
...
...
@@ -12,7 +12,7 @@ const { ccclass, property } = cc._decorator;
// 爪子状态
const
CLIP_STATE
=
{
/** 默认 */
DEFAULT
:
'
default
'
,
DEFAULT
:
'
clipAni
'
,
/** 出钩 */
PLAY
:
'clipPlay'
,
/** 收回 */
...
...
@@ -50,9 +50,9 @@ export default class NewClass extends cc.Component {
start
()
{
this
.
refreshLevelInfo
()
this
.
clipAni
=
cc
.
find
(
'clip
/clipWrp/defa
'
,
this
.
node
).
getComponent
(
cc
.
Animation
)
this
.
clipAni
=
cc
.
find
(
'clip
Wrp/clip
'
,
this
.
node
).
getComponent
(
cc
.
Animation
)
this
.
addNodeEvent
()
this
.
node
.
on
(
"test"
,
this
.
onAnimCompleted
,
this
)
this
.
node
.
on
(
"test"
,
this
.
onAnimCompleted
,
this
)
}
/** 爪子事件 */
...
...
@@ -72,19 +72,12 @@ export default class NewClass extends cc.Component {
addNodeEvent
()
{
const
gameBtn
=
cc
.
find
(
'gameBtn'
,
this
.
node
)
gameBtn
.
on
(
cc
.
Node
.
EventType
.
TOUCH_END
,
this
.
playGame
,
this
)
const
clip
=
this
.
clipAni
clip
.
on
(
'palyEnd'
,
()
=>
{
console
.
log
(
'end'
)
},
this
)
clip
.
on
(
'stop'
,
()
=>
{
},
this
)
}
/** 设置爪子状态 */
setClipState
(
state
)
{
const
ani
=
cc
.
find
(
'clip
/clip
Wrp'
,
this
.
node
).
getComponent
(
cc
.
Animation
)
const
node
=
cc
.
find
(
'clip
/clipWrp/defa
'
,
this
.
node
)
const
ani
=
cc
.
find
(
'clipWrp'
,
this
.
node
).
getComponent
(
cc
.
Animation
)
const
node
=
cc
.
find
(
'clip
Wrp/clip
'
,
this
.
node
)
const
clip
=
node
.
getComponent
(
cc
.
Animation
),
spf
=
node
.
getComponent
(
cc
.
Sprite
).
spriteFrame
spf
.
insetBottom
=
125
spf
.
insetTop
=
10
...
...
@@ -92,12 +85,16 @@ export default class NewClass extends cc.Component {
switch
(
state
)
{
case
CLIP_STATE
.
DEFAULT
:
ani
.
resume
()
clip
.
play
(
state
)
break
;
case
CLIP_STATE
.
PLAY
:
clip
.
pause
(
CLIP_STATE
.
DEFAULT
)
ani
.
pause
()
clip
.
play
(
state
)
break
;
case
CLIP_STATE
.
STOP
:
clip
.
pause
(
CLIP_STATE
.
DEFAULT
)
ani
.
pause
()
clip
.
play
(
state
)
break
;
...
...
assets/Script/ImgFixedSize.ts
0 → 100644
View file @
9d1fbece
const
{
ccclass
,
property
,
menu
}
=
cc
.
_decorator
;
/**
* 图片适配大小
*/
@
ccclass
@
menu
(
"framework/ImgFixedSize"
)
export
default
class
ImgFixedSize
extends
cc
.
Component
{
@
property
({
type
:
cc
.
Integer
,
tooltip
:
"固定尺寸"
})
public
set
fixedSize
(
value
)
{
this
.
_fixedSize
=
value
;
this
.
onSizeChanged
();
}
public
get
fixedSize
()
{
return
this
.
_fixedSize
;
}
@
property
({
type
:
cc
.
Integer
,
tooltip
:
"固定尺寸"
})
private
_fixedSize
:
number
=
1
;
onLoad
()
{
this
.
_fixedSize
=
this
.
fixedSize
;
this
.
node
.
on
(
cc
.
Node
.
EventType
.
SIZE_CHANGED
,
this
.
onSizeChanged
,
this
);
this
.
onSizeChanged
();
}
/**当尺寸变化时,重置node节点大小 */
onSizeChanged
()
{
var
width
=
this
.
node
.
width
;
var
height
=
this
.
node
.
height
;
var
max
=
Math
.
max
(
width
,
height
);
this
.
node
.
scale
=
this
.
fixedSize
/
max
;
}
}
\ No newline at end of file
assets/Script/ImgFixedSize.ts.meta
0 → 100644
View file @
9d1fbece
{
"ver": "1.1.0",
"uuid": "3ea06ec2-26e8-46c4-9994-b2e659d578de",
"importer": "typescript",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
assets/Script/utils.ts
View file @
9d1fbece
/**
* 十六进制颜色转rgb
* @param str
* @returns
*/
export
const
set16ToRgb
=
(
str
)
=>
{
if
(
!
str
)
return
var
reg
=
/^#
([
0-9A-Fa-f
]{3}
|
[
0-9A-Fa-f
]{6})
$/
...
...
assets/resources/assets/ani/clipAni.anim
View file @
9d1fbece
This diff is collapsed.
Click to expand it.
assets/resources/assets/ani/clipPlay.anim
View file @
9d1fbece
...
...
@@ -19,7 +19,8 @@
"value": 648
}
]
}
},
"paths": {}
},
"events": [
{
...
...
assets/resources/assets/ani/clipStop.anim
View file @
9d1fbece
...
...
@@ -19,7 +19,8 @@
"value": 648
}
]
}
},
"paths": {}
},
"events": [
{
...
...
assets/resources/assets/images/clips/夹子待机_00000.png.meta
View file @
9d1fbece
...
...
@@ -28,9 +28,9 @@
"height": 138,
"rawWidth": 120,
"rawHeight": 154,
"borderTop":
0
,
"borderBottom":
0
,
"borderLeft":
0
,
"borderTop":
4
,
"borderBottom":
119
,
"borderLeft":
85
,
"borderRight": 0,
"subMetas": {}
}
...
...
assets/resources/assets/images/line.png
0 → 100644
View file @
9d1fbece
674 Bytes
assets/resources/assets/images/line.png.meta
0 → 100644
View file @
9d1fbece
{
"ver": "2.3.7",
"uuid": "33aac5d8-2d22-4838-9632-057853ac75ad",
"importer": "texture",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 11,
"height": 44,
"platformSettings": {},
"subMetas": {
"line": {
"ver": "1.0.6",
"uuid": "f0d6e4a1-32f5-4e09-b07d-6f92c846a696",
"importer": "sprite-frame",
"rawTextureUuid": "33aac5d8-2d22-4838-9632-057853ac75ad",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 11,
"height": 44,
"rawWidth": 11,
"rawHeight": 44,
"borderTop": 20,
"borderBottom": 7,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
assets/resources/assets/images/stop.meta
0 → 100644
View file @
9d1fbece
{
"ver": "1.1.3",
"uuid": "85fe8788-0729-4434-a620-501ed6157527",
"importer": "folder",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
assets/resources/assets/images/stop/夹子夹_00000.png
0 → 100644
View file @
9d1fbece
11.6 KB
assets/resources/assets/images/stop/夹子夹_00000.png.meta
0 → 100644
View file @
9d1fbece
{
"ver": "2.3.7",
"uuid": "51faa006-8beb-4f2b-b4b5-0b655f1da2cf",
"importer": "texture",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 133,
"height": 145,
"platformSettings": {},
"subMetas": {
"夹子夹_00000": {
"ver": "1.0.6",
"uuid": "9f9b15ed-14ef-441f-a30c-09ef39aa5da4",
"importer": "sprite-frame",
"rawTextureUuid": "51faa006-8beb-4f2b-b4b5-0b655f1da2cf",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0.5,
"offsetY": 2,
"trimX": 7,
"trimY": 1,
"width": 120,
"height": 139,
"rawWidth": 133,
"rawHeight": 145,
"borderTop": 5,
"borderBottom": 120,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
assets/resources/assets/images/stop/夹子夹_00001.png
0 → 100644
View file @
9d1fbece
11.7 KB
assets/resources/assets/images/stop/夹子夹_00001.png.meta
0 → 100644
View file @
9d1fbece
{
"ver": "2.3.7",
"uuid": "021bf573-d016-49e7-8602-f0225a9c6e46",
"importer": "texture",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 133,
"height": 145,
"platformSettings": {},
"subMetas": {
"夹子夹_00001": {
"ver": "1.0.6",
"uuid": "2476d47e-cf46-4888-b9a0-7cc039485dd2",
"importer": "sprite-frame",
"rawTextureUuid": "021bf573-d016-49e7-8602-f0225a9c6e46",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 1,
"offsetY": 1,
"trimX": 11,
"trimY": 1,
"width": 113,
"height": 141,
"rawWidth": 133,
"rawHeight": 145,
"borderTop": 7,
"borderBottom": 122,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
assets/resources/assets/images/stop/夹子夹_00002.png
0 → 100644
View file @
9d1fbece
11.6 KB
assets/resources/assets/images/stop/夹子夹_00002.png.meta
0 → 100644
View file @
9d1fbece
{
"ver": "2.3.7",
"uuid": "d9f8161a-adac-4f05-90ce-db88e3e78168",
"importer": "texture",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 133,
"height": 145,
"platformSettings": {},
"subMetas": {
"夹子夹_00002": {
"ver": "1.0.6",
"uuid": "d75a7db3-1b4a-450f-b766-745a8172efa8",
"importer": "sprite-frame",
"rawTextureUuid": "d9f8161a-adac-4f05-90ce-db88e3e78168",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0.5,
"offsetY": 0.5,
"trimX": 15,
"trimY": 1,
"width": 104,
"height": 142,
"rawWidth": 133,
"rawHeight": 145,
"borderTop": 7.5,
"borderBottom": 122.5,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
assets/resources/assets/images/stop/夹子夹_00003.png
0 → 100644
View file @
9d1fbece
11.5 KB
assets/resources/assets/images/stop/夹子夹_00003.png.meta
0 → 100644
View file @
9d1fbece
{
"ver": "2.3.7",
"uuid": "6e2ca9c0-e5cc-4280-aed8-bb8d6da56ee6",
"importer": "texture",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 133,
"height": 145,
"platformSettings": {},
"subMetas": {
"夹子夹_00003": {
"ver": "1.0.6",
"uuid": "57f3929b-38bc-4532-a855-a125d00755cc",
"importer": "sprite-frame",
"rawTextureUuid": "6e2ca9c0-e5cc-4280-aed8-bb8d6da56ee6",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 1,
"offsetY": 1,
"trimX": 18,
"trimY": 1,
"width": 99,
"height": 141,
"rawWidth": 133,
"rawHeight": 145,
"borderTop": 7,
"borderBottom": 122,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
assets/resources/assets/images/stop/夹子夹_00004.png
0 → 100644
View file @
9d1fbece
11.7 KB
assets/resources/assets/images/stop/夹子夹_00004.png.meta
0 → 100644
View file @
9d1fbece
{
"ver": "2.3.7",
"uuid": "70486fc8-019b-4f85-8f2f-6423f4721ccb",
"importer": "texture",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 96,
"height": 138,
"platformSettings": {},
"subMetas": {
"夹子夹_00004": {
"ver": "1.0.6",
"uuid": "b08167e4-2bc5-464c-b4b1-b8646889045f",
"importer": "sprite-frame",
"rawTextureUuid": "70486fc8-019b-4f85-8f2f-6423f4721ccb",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 96,
"height": 138,
"rawWidth": 96,
"rawHeight": 138,
"borderTop": 15,
"borderBottom": 116,
"borderLeft": 85,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
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