Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
car
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
car
Commits
bde8faa6
Commit
bde8faa6
authored
Jun 03, 2025
by
haiyoucuv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
init
parent
5401b2b4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
8 deletions
+26
-8
OverPanel.ts
assets/Scripts/Panels/OverPanel.ts
+12
-5
HomeScene.ts
assets/Scripts/Scenes/HomeScene.ts
+4
-1
gameStore.ts
assets/Scripts/store/gameStore.ts
+10
-2
No files found.
assets/Scripts/Panels/OverPanel.ts
View file @
bde8faa6
...
@@ -4,6 +4,9 @@ import Panel from "db://assets/core/Module/Panel";
...
@@ -4,6 +4,9 @@ import Panel from "db://assets/core/Module/Panel";
import
{
changeScene
}
from
"db://assets/core/Module/UIFast"
;
import
{
changeScene
}
from
"db://assets/core/Module/UIFast"
;
import
{
HomeScene
}
from
"db://assets/Scripts/Scenes/HomeScene"
;
import
{
HomeScene
}
from
"db://assets/Scripts/Scenes/HomeScene"
;
import
store
from
"db://assets/Scripts/store/store"
;
import
store
from
"db://assets/Scripts/store/store"
;
import
gameStore
from
"db://assets/Scripts/store/gameStore"
;
import
{
MainGame
}
from
"db://assets/Scripts/Scenes/MainGame/MainGame"
;
import
{
_asyncThrottle
}
from
"db://assets/Scripts/Utils/Utils"
;
const
{
ccclass
,
property
}
=
_decorator
;
const
{
ccclass
,
property
}
=
_decorator
;
...
@@ -25,25 +28,29 @@ export class OverPanel extends Panel {
...
@@ -25,25 +28,29 @@ export class OverPanel extends Panel {
start
():
void
{
start
():
void
{
this
.
tip
.
string
=
`第
${
this
.
data
.
passLevel
}
关`
;
this
.
tip
.
string
=
`第
${
this
.
data
.
passLevel
}
关`
;
if
(
store
.
homeInfo
.
freeTimes
)
{
if
(
store
.
homeInfo
.
freeTimes
)
{
this
.
tip2
.
string
=
`免费次数:
${
store
.
homeInfo
.
freeTimes
}
`
;
this
.
tip2
.
string
=
`免费次数:
${
store
.
homeInfo
.
freeTimes
}
`
;
}
else
{
}
else
{
this
.
tip2
.
string
=
`
${
store
.
homeInfo
.
gameCreditsEach
}
积分/次`
;
this
.
tip2
.
string
=
`
${
store
.
homeInfo
.
gameCreditsEach
}
积分/次`
;
}
}
}
}
cancel
=
()
=>
{
cancel
=
()
=>
{
AudioMgr
.
ins
.
playOneShot
(
AudioClipName
.
button_ok
);
AudioMgr
.
ins
.
playOneShot
(
AudioClipName
.
button_ok
);
this
.
hidePanel
();
this
.
hidePanel
();
changeScene
(
HomeScene
);
}
}
ok
=
()
=>
{
ok
=
_asyncThrottle
(
async
()
=>
{
AudioMgr
.
ins
.
playOneShot
(
AudioClipName
.
button_ok
);
AudioMgr
.
ins
.
playOneShot
(
AudioClipName
.
button_ok
);
// changeScene(HomeScene);
const
suc
=
await
gameStore
.
start
();
if
(
!
suc
)
return
this
.
hidePanel
();
this
.
hidePanel
();
changeScene
(
HomeScen
e
);
changeScene
(
MainGam
e
);
}
}
)
}
}
...
...
assets/Scripts/Scenes/HomeScene.ts
View file @
bde8faa6
...
@@ -78,12 +78,13 @@ export class HomeScene extends Scene {
...
@@ -78,12 +78,13 @@ export class HomeScene extends Scene {
const
{
const
{
freeTimes
=
0
,
freeTimes
=
0
,
boxConfigs
=
[],
boxConfigs
=
[],
gameCreditsEach
,
}
=
store
.
homeInfo
||
{};
}
=
store
.
homeInfo
||
{};
if
(
+
freeTimes
)
{
if
(
+
freeTimes
)
{
this
.
timesLabel
.
string
=
`免费次数:
${
freeTimes
}
`
;
this
.
timesLabel
.
string
=
`免费次数:
${
freeTimes
}
`
;
}
else
{
}
else
{
this
.
timesLabel
.
string
=
`
20
积分/次`
;
this
.
timesLabel
.
string
=
`
${
gameCreditsEach
}
积分/次`
;
}
}
this
.
boxRoot
.
removeAllChildren
();
this
.
boxRoot
.
removeAllChildren
();
...
@@ -116,9 +117,11 @@ export class HomeScene extends Scene {
...
@@ -116,9 +117,11 @@ export class HomeScene extends Scene {
}
}
openBox
=
_asyncThrottle
(
async
function
(
item
)
{
openBox
=
_asyncThrottle
(
async
function
(
item
)
{
if
(
!
store
.
checkActTime
())
return
;
const
{
id
,
status
,
targetLevel
}
=
item
;
const
{
id
,
status
,
targetLevel
}
=
item
;
if
(
+
status
!=
1
)
return
;
if
(
+
status
!=
1
)
return
;
const
{
success
,
data
}
=
await
sendWebNet
(
WebNetName
.
openBox
,
{
id
});
const
{
success
,
data
}
=
await
sendWebNet
(
WebNetName
.
openBox
,
{
id
});
store
.
updateIndex
();
if
(
!
success
)
return
;
if
(
!
success
)
return
;
await
showPanel
(
BoxPanel
,
data
);
await
showPanel
(
BoxPanel
,
data
);
},
500
)
},
500
)
...
...
assets/Scripts/store/gameStore.ts
View file @
bde8faa6
...
@@ -37,11 +37,15 @@ class GameStore {
...
@@ -37,11 +37,15 @@ class GameStore {
}
}
const
{
success
,
ticket
}
=
await
creditsCost
(
"main"
,
"start"
,
"deduct_credits_desc"
,
gameCreditsEach
);
const
{
success
,
ticket
}
=
await
creditsCost
(
"main"
,
"start"
,
"deduct_credits_desc"
,
gameCreditsEach
);
if
(
!
success
)
return
false
;
if
(
!
success
)
{
await
store
.
updateIndex
();
return
false
;
}
params
.
ticketNum
=
ticket
;
params
.
ticketNum
=
ticket
;
}
}
const
{
success
,
data
}
=
await
sendWebNet
(
WebNetName
.
start
,
params
);
const
{
success
,
data
}
=
await
sendWebNet
(
WebNetName
.
start
,
params
);
store
.
updateIndex
();
if
(
!
success
)
return
false
;
if
(
!
success
)
return
false
;
...
@@ -74,11 +78,15 @@ class GameStore {
...
@@ -74,11 +78,15 @@ class GameStore {
if
(
type
===
"credits"
)
{
if
(
type
===
"credits"
)
{
const
{
success
,
ticket
}
=
await
creditsCost
(
"main"
,
"unlockPark"
,
"deduct_credits_desc"
,
unparkCreditsNum
);
const
{
success
,
ticket
}
=
await
creditsCost
(
"main"
,
"unlockPark"
,
"deduct_credits_desc"
,
unparkCreditsNum
);
if
(
!
success
)
return
false
;
if
(
!
success
)
{
await
store
.
updateIndex
();
return
false
;
}
params
.
ticketNum
=
ticket
;
params
.
ticketNum
=
ticket
;
}
}
const
{
success
,
data
}
=
await
sendWebNet
(
WebNetName
.
unlockPark
,
params
);
const
{
success
,
data
}
=
await
sendWebNet
(
WebNetName
.
unlockPark
,
params
);
store
.
updateIndex
();
if
(
!
success
)
return
false
;
if
(
!
success
)
return
false
;
...
...
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