Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
TNGD_CaveCruiser
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
TNGD_CaveCruiser
Commits
f0372884
Commit
f0372884
authored
Sep 13, 2024
by
haiyoucuv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
上传
parent
6b5fa173
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
231 additions
and
23 deletions
+231
-23
MusicBtn.ts
assets/Component/MusicBtn/MusicBtn.ts
+34
-10
Start.ts
assets/Start/Start.ts
+16
-1
AudioMgr.ts
assets/core_tgx/base/AudioMgr.ts
+8
-1
NoPrizePanel.prefab
assets/resources/NoPrizePanel/NoPrizePanel.prefab
+6
-6
PrizePanel.prefab
assets/resources/PrizePanel/PrizePanel.prefab
+167
-5
bg.png
assets/resources/PrizePanel/png/bg.png
+0
-0
No files found.
assets/Component/MusicBtn/MusicBtn.ts
View file @
f0372884
...
@@ -6,38 +6,62 @@ const {ccclass, property} = _decorator;
...
@@ -6,38 +6,62 @@ const {ccclass, property} = _decorator;
@
ccclass
(
'MusicBtn'
)
@
ccclass
(
'MusicBtn'
)
export
class
MusicBtn
extends
Component
{
export
class
MusicBtn
extends
Component
{
@
property
(
SpriteFrame
)
closeSf
:
SpriteFrame
=
null
;
@
property
(
SpriteFrame
)
openSf
:
SpriteFrame
=
null
;
s
p
:
Sprite
=
null
;
s
tatic
btnList
:
MusicBtn
[]
=
[]
;
private
_open
:
boolean
=
fals
e
;
private
static
_open
:
boolean
=
tru
e
;
set
open
(
open
:
boolean
)
{
s
tatic
s
et
open
(
open
:
boolean
)
{
this
.
_open
=
open
;
this
.
_open
=
open
;
this
.
sp
.
spriteFrame
=
open
?
this
.
openSf
:
this
.
closeSf
;
for
(
const
btn
of
this
.
btnList
)
{
btn
.
open
=
open
;
}
if
(
open
)
{
if
(
open
)
{
AudioMgr
.
ins
.
resume
();
AudioMgr
.
ins
.
resume
();
AudioMgr
.
ins
.
musicVolume
=
1
;
AudioMgr
.
ins
.
soundVolume
=
1
;
}
else
{
}
else
{
AudioMgr
.
ins
.
pause
();
AudioMgr
.
ins
.
stop
();
AudioMgr
.
ins
.
musicVolume
=
0
;
AudioMgr
.
ins
.
soundVolume
=
0
;
}
}
}
}
static
get
open
()
{
return
this
.
_open
;
}
@
property
(
SpriteFrame
)
closeSf
:
SpriteFrame
=
null
;
@
property
(
SpriteFrame
)
openSf
:
SpriteFrame
=
null
;
sp
:
Sprite
=
null
;
private
_open
:
boolean
=
true
;
set
open
(
open
:
boolean
)
{
this
.
_open
=
open
;
this
.
sp
.
spriteFrame
=
open
?
this
.
openSf
:
this
.
closeSf
;
}
get
open
()
{
get
open
()
{
return
this
.
_open
;
return
this
.
_open
;
}
}
onLoad
()
{
onLoad
()
{
this
.
sp
=
this
.
getComponent
(
Sprite
);
this
.
sp
=
this
.
getComponent
(
Sprite
);
MusicBtn
.
btnList
.
push
(
this
);
MusicBtn
.
open
=
MusicBtn
.
open
;
this
.
node
.
on
(
Button
.
EventType
.
CLICK
,
this
.
clickNode
,
this
);
this
.
node
.
on
(
Button
.
EventType
.
CLICK
,
this
.
clickNode
,
this
);
}
}
start
()
{
protected
onDestroy
()
{
this
.
open
=
true
;
MusicBtn
.
btnList
.
splice
(
MusicBtn
.
btnList
.
indexOf
(
this
),
1
)
;
}
}
clickNode
()
{
clickNode
()
{
this
.
open
=
!
this
.
open
;
MusicBtn
.
open
=
!
MusicBtn
.
open
;
}
}
}
}
...
...
assets/Start/Start.ts
View file @
f0372884
import
{
_decorator
,
assetManager
,
game
,
Component
,
Label
,
Node
,
Prefab
,
profiler
,
ProgressBar
,
resources
,
}
from
'cc'
;
import
{
_decorator
,
assetManager
,
game
,
Component
,
Label
,
Node
,
Prefab
,
profiler
,
ProgressBar
,
resources
,
input
,
Input
,
}
from
'cc'
;
import
{
PREVIEW
}
from
'cc/env'
;
import
{
PREVIEW
}
from
'cc/env'
;
import
{
UIMgr
}
from
"../Module/UIMgr"
;
import
{
UIMgr
}
from
"../Module/UIMgr"
;
import
{
changeScene
,
showToast
}
from
"db://assets/Module/UIFast"
;
import
{
changeScene
,
showToast
}
from
"db://assets/Module/UIFast"
;
...
@@ -7,6 +19,7 @@ import { sendWebNet, WebNetName } from "../Scripts/Utils/WebNet/WebNet";
...
@@ -7,6 +19,7 @@ import { sendWebNet, WebNetName } from "../Scripts/Utils/WebNet/WebNet";
import
{
getUrlParams
}
from
"../Scripts/Utils/WebNet/web/webTools"
;
import
{
getUrlParams
}
from
"../Scripts/Utils/WebNet/web/webTools"
;
import
store
from
"../Scripts/store/store"
;
import
store
from
"../Scripts/store/store"
;
import
{
AudioMgr
}
from
"../core_tgx/base/AudioMgr"
;
import
{
AudioMgr
}
from
"../core_tgx/base/AudioMgr"
;
import
{
MusicBtn
}
from
"../Component/MusicBtn/MusicBtn"
;
const
{
ccclass
,
property
}
=
_decorator
;
const
{
ccclass
,
property
}
=
_decorator
;
...
@@ -40,6 +53,8 @@ export class Start extends Component {
...
@@ -40,6 +53,8 @@ export class Start extends Component {
document
.
body
.
style
.
visibility
=
"visible"
;
document
.
body
.
style
.
visibility
=
"visible"
;
MusicBtn
.
open
=
false
;
}
}
onDestroy
()
{
onDestroy
()
{
...
...
assets/core_tgx/base/AudioMgr.ts
View file @
f0372884
...
@@ -39,6 +39,13 @@ export class AudioMgr {
...
@@ -39,6 +39,13 @@ export class AudioMgr {
//@en add AudioSource componrnt to play audios.
//@en add AudioSource componrnt to play audios.
//@zh 添加 AudioSource 组件,用于播放音频。
//@zh 添加 AudioSource 组件,用于播放音频。
this
.
_audioSource
=
audioMgr
.
addComponent
(
AudioSource
);
this
.
_audioSource
=
audioMgr
.
addComponent
(
AudioSource
);
this
.
_audioSource
.
onEnable
=
()
=>
{
}
this
.
_audioSource
.
onDisable
=
()
=>
{
}
}
}
public
get
audioSource
()
{
public
get
audioSource
()
{
...
@@ -62,7 +69,7 @@ export class AudioMgr {
...
@@ -62,7 +69,7 @@ export class AudioMgr {
* @param sound clip or url for the audio
* @param sound clip or url for the audio
* @param volume
* @param volume
*/
*/
playOneShot
(
sound
:
AudioClip
|
string
,
volume
:
number
=
1
,
bundleName
:
string
=
'resources'
)
{
playOneShot
(
sound
:
AudioClip
|
string
,
volume
:
number
=
this
.
_soundVolume
,
bundleName
:
string
=
'resources'
)
{
if
(
sound
instanceof
AudioClip
)
{
if
(
sound
instanceof
AudioClip
)
{
this
.
_audioSource
.
volume
=
1.0
;
this
.
_audioSource
.
volume
=
1.0
;
this
.
_audioSource
.
playOneShot
(
sound
,
volume
*
this
.
_soundVolume
);
this
.
_audioSource
.
playOneShot
(
sound
,
volume
*
this
.
_soundVolume
);
...
...
assets/resources/NoPrizePanel/NoPrizePanel.prefab
View file @
f0372884
...
@@ -1102,9 +1102,9 @@
...
@@ -1102,9 +1102,9 @@
"_dstBlendFactor": 4,
"_dstBlendFactor": 4,
"_color": {
"_color": {
"__type__": "cc.Color",
"__type__": "cc.Color",
"r": 2
55
,
"r": 2
09
,
"g": 2
5
5,
"g": 2
3
5,
"b": 25
5
,
"b": 25
1
,
"a": 255
"a": 255
},
},
"_string": "Better luck next time",
"_string": "Better luck next time",
...
@@ -1770,9 +1770,9 @@
...
@@ -1770,9 +1770,9 @@
"_dstBlendFactor": 4,
"_dstBlendFactor": 4,
"_color": {
"_color": {
"__type__": "cc.Color",
"__type__": "cc.Color",
"r": 2
55
,
"r": 2
09
,
"g": 2
5
5,
"g": 2
3
5,
"b": 25
5
,
"b": 25
1
,
"a": 255
"a": 255
},
},
"_string": "System exception.\nYou can check the coupon pack later\nto see i",
"_string": "System exception.\nYou can check the coupon pack later\nto see i",
...
...
assets/resources/PrizePanel/PrizePanel.prefab
View file @
f0372884
...
@@ -47,19 +47,22 @@
...
@@ -47,19 +47,22 @@
},
},
{
{
"__id__": 86
"__id__": 86
},
{
"__id__": 96
}
}
],
],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__":
96
"__id__":
102
},
},
{
{
"__id__":
98
"__id__":
104
}
}
],
],
"_prefab": {
"_prefab": {
"__id__": 10
0
"__id__": 10
6
},
},
"_lpos": {
"_lpos": {
"__type__": "cc.Vec3",
"__type__": "cc.Vec3",
...
@@ -2277,6 +2280,165 @@
...
@@ -2277,6 +2280,165 @@
"targetOverrides": null,
"targetOverrides": null,
"nestedPrefabInstanceRoots": null
"nestedPrefabInstanceRoots": null
},
},
{
"__type__": "cc.Node",
"_name": "You won",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
"__id__": 1
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 97
},
{
"__id__": 99
}
],
"_prefab": {
"__id__": 101
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 215.481,
"z": 0
},
"_lrot": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_mobility": 0,
"_layer": 33554432,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": ""
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 96
},
"_enabled": true,
"__prefab": {
"__id__": 98
},
"_contentSize": {
"__type__": "cc.Size",
"width": 103.16465759277344,
"height": 34.208999999999996
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "4e2gFneM5CWYVJO2N2fmIM"
},
{
"__type__": "cc.Label",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 96
},
"_enabled": true,
"__prefab": {
"__id__": 100
},
"_customMaterial": null,
"_srcBlendFactor": 2,
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 209,
"g": 235,
"b": 251,
"a": 255
},
"_string": "You won",
"_horizontalAlign": 1,
"_verticalAlign": 1,
"_actualFontSize": 27.15,
"_fontSize": 27.15,
"_fontFamily": "Arial",
"_lineHeight": 27.15,
"_overflow": 0,
"_enableWrapText": true,
"_font": null,
"_isSystemFontUsed": true,
"_spacingX": 0,
"_isItalic": false,
"_isBold": false,
"_isUnderline": false,
"_underlineHeight": 2,
"_cacheMode": 0,
"_enableOutline": false,
"_outlineColor": {
"__type__": "cc.Color",
"r": 0,
"g": 0,
"b": 0,
"a": 255
},
"_outlineWidth": 2,
"_enableShadow": false,
"_shadowColor": {
"__type__": "cc.Color",
"r": 0,
"g": 0,
"b": 0,
"a": 255
},
"_shadowOffset": {
"__type__": "cc.Vec2",
"x": 2,
"y": 2
},
"_shadowBlur": 2,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "5axHmdStBDI6pn/83bDDV4"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "fdW/UroghGbrwd6gAK82SM",
"instance": null,
"targetOverrides": null,
"nestedPrefabInstanceRoots": null
},
{
{
"__type__": "cc.UITransform",
"__type__": "cc.UITransform",
"_name": "",
"_name": "",
...
@@ -2287,7 +2449,7 @@
...
@@ -2287,7 +2449,7 @@
},
},
"_enabled": true,
"_enabled": true,
"__prefab": {
"__prefab": {
"__id__":
97
"__id__":
103
},
},
"_contentSize": {
"_contentSize": {
"__type__": "cc.Size",
"__type__": "cc.Size",
...
@@ -2315,7 +2477,7 @@
...
@@ -2315,7 +2477,7 @@
},
},
"_enabled": true,
"_enabled": true,
"__prefab": {
"__prefab": {
"__id__":
99
"__id__":
105
},
},
"closeBtn": {
"closeBtn": {
"__id__": 86
"__id__": 86
...
...
assets/resources/PrizePanel/png/bg.png
View replaced file @
6b5fa173
View file @
f0372884
168 KB
|
W:
|
H:
168 KB
|
W:
|
H:
2-up
Swipe
Onion skin
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