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
7c5a77b7
Commit
7c5a77b7
authored
May 30, 2025
by
haiyoucuv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
init
parent
369d8f09
Changes
10
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
489 additions
and
70 deletions
+489
-70
MainGame.scene
assets/Bundles/MainGame/MainGame.scene
+409
-50
CarColorsGlobalInstance.ts
assets/CarColorsGame/Scrips/CarColorsGlobalInstance.ts
+2
-2
SucPanel.ts
assets/Scripts/Panels/SucPanel.ts
+2
-1
MainGame.ts
assets/Scripts/Scenes/MainGame/MainGame.ts
+4
-4
Systerms.meta
assets/Scripts/Scenes/MainGame/Systerms.meta
+0
-0
CarCarColorsSysterm.ts
...s/Scripts/Scenes/MainGame/Systerms/CarCarColorsSysterm.ts
+5
-5
CarCarColorsSysterm.ts.meta
...ipts/Scenes/MainGame/Systerms/CarCarColorsSysterm.ts.meta
+0
-0
RoleCarColorsSysterm.ts
.../Scripts/Scenes/MainGame/Systerms/RoleCarColorsSysterm.ts
+58
-4
RoleCarColorsSysterm.ts.meta
...pts/Scenes/MainGame/Systerms/RoleCarColorsSysterm.ts.meta
+0
-0
gameStore.ts
assets/Scripts/store/gameStore.ts
+9
-4
No files found.
assets/Bundles/MainGame/MainGame.scene
View file @
7c5a77b7
This diff is collapsed.
Click to expand it.
assets/CarColorsGame/Scrips/CarColorsGlobalInstance.ts
View file @
7c5a77b7
import
{
_decorator
,
Component
,
Node
}
from
'cc'
;
import
{
_decorator
,
Component
,
Node
}
from
'cc'
;
import
{
RoleCarColorsSysterm
}
from
'./Systerms/RoleCarColorsSysterm'
;
import
{
RoleCarColorsSysterm
}
from
'.
./../Scripts/Scenes/MainGame
/Systerms/RoleCarColorsSysterm'
;
import
{
CarCarColorsSysterm
}
from
'./Systerms/CarCarColorsSysterm'
;
import
{
CarCarColorsSysterm
}
from
'.
./../Scripts/Scenes/MainGame
/Systerms/CarCarColorsSysterm'
;
const
{
ccclass
,
property
}
=
_decorator
;
const
{
ccclass
,
property
}
=
_decorator
;
@
ccclass
(
'CarColorsGlobalInstance'
)
@
ccclass
(
'CarColorsGlobalInstance'
)
...
...
assets/Scripts/Panels/SucPanel.ts
View file @
7c5a77b7
...
@@ -23,7 +23,8 @@ export class SucPanel extends Panel {
...
@@ -23,7 +23,8 @@ export class SucPanel extends Panel {
}
}
start
():
void
{
start
():
void
{
this
.
levelNum
.
string
=
`第
${
this
.
data
.
passLevel
}
关`
;
this
.
boxNum
.
string
=
`挑战宝箱*
${
this
.
data
.
boxNum
}
`
;
}
}
cancel
=
()
=>
{
cancel
=
()
=>
{
...
...
assets/Scripts/Scenes/MainGame/MainGame.ts
View file @
7c5a77b7
...
@@ -4,8 +4,8 @@ import { changeScene, showPanel, showToast } from "db://assets/core/Module/UIFas
...
@@ -4,8 +4,8 @@ import { changeScene, showPanel, showToast } from "db://assets/core/Module/UIFas
import
{
AudioClipName
,
AudioMgr
}
from
"db://assets/core/base/AudioMgr"
;
import
{
AudioClipName
,
AudioMgr
}
from
"db://assets/core/base/AudioMgr"
;
import
{
HomeScene
}
from
"db://assets/Scripts/Scenes/HomeScene"
;
import
{
HomeScene
}
from
"db://assets/Scripts/Scenes/HomeScene"
;
import
{
CarColorsGlobalInstance
}
from
"db://assets/CarColorsGame/Scrips/CarColorsGlobalInstance"
;
import
{
CarColorsGlobalInstance
}
from
"db://assets/CarColorsGame/Scrips/CarColorsGlobalInstance"
;
import
{
RoleCarColorsSysterm
}
from
"
db://assets/CarColorsGame/Scrips
/Systerms/RoleCarColorsSysterm"
;
import
{
RoleCarColorsSysterm
}
from
"
.
/Systerms/RoleCarColorsSysterm"
;
import
{
CarCarColorsSysterm
}
from
"
db://assets/CarColorsGame/Scrips
/Systerms/CarCarColorsSysterm"
;
import
{
CarCarColorsSysterm
}
from
"
.
/Systerms/CarCarColorsSysterm"
;
import
{
SuccessPage
}
from
"db://assets/Scripts/Panels/SuccessPage"
;
import
{
SuccessPage
}
from
"db://assets/Scripts/Panels/SuccessPage"
;
import
{
PlatformManager
}
from
"db://assets/ScriptFrame/Frame/platformManager"
;
import
{
PlatformManager
}
from
"db://assets/ScriptFrame/Frame/platformManager"
;
import
gameStore
from
"db://assets/Scripts/store/gameStore"
;
import
gameStore
from
"db://assets/Scripts/store/gameStore"
;
...
@@ -35,11 +35,11 @@ export class MainGame extends Scene {
...
@@ -35,11 +35,11 @@ export class MainGame extends Scene {
async
start
()
{
async
start
()
{
// 人物管理系统
// 人物管理系统
CarColorsGlobalInstance
.
instance
.
roleSysterm
=
this
.
node
.
add
Component
(
RoleCarColorsSysterm
)
CarColorsGlobalInstance
.
instance
.
roleSysterm
=
this
.
node
.
get
Component
(
RoleCarColorsSysterm
)
await
CarColorsGlobalInstance
.
instance
.
roleSysterm
.
loadRolePrefabs
();
await
CarColorsGlobalInstance
.
instance
.
roleSysterm
.
loadRolePrefabs
();
// 汽车管理系统
// 汽车管理系统
CarColorsGlobalInstance
.
instance
.
carSysterm
=
this
.
node
.
add
Component
(
CarCarColorsSysterm
)
CarColorsGlobalInstance
.
instance
.
carSysterm
=
this
.
node
.
get
Component
(
CarCarColorsSysterm
)
await
this
.
nextLevel
();
await
this
.
nextLevel
();
}
}
...
...
assets/
CarColorsGame/Scrips
/Systerms.meta
→
assets/
Scripts/Scenes/MainGame
/Systerms.meta
View file @
7c5a77b7
File moved
assets/
CarColorsGame/Scrips
/Systerms/CarCarColorsSysterm.ts
→
assets/
Scripts/Scenes/MainGame
/Systerms/CarCarColorsSysterm.ts
View file @
7c5a77b7
import
{
_decorator
,
Component
,
find
,
geometry
,
Node
,
PhysicsSystem
}
from
'cc'
;
import
{
_decorator
,
Component
,
find
,
geometry
,
Node
,
PhysicsSystem
}
from
'cc'
;
import
{
CarColors
,
CarTypes
}
from
'
..
/CarColorsGlobalTypes'
;
import
{
CarColors
,
CarTypes
}
from
'
db://assets/CarColorsGame/Scrips
/CarColorsGlobalTypes'
;
import
{
CarCarColorsComponent
}
from
'
..
/Components/CarCarColorsComponent'
;
import
{
CarCarColorsComponent
}
from
'
db://assets/CarColorsGame/Scrips
/Components/CarCarColorsComponent'
;
import
{
CarBoxComponent
}
from
'
..
/Components/CarBoxComponent'
;
import
{
CarBoxComponent
}
from
'
db://assets/CarColorsGame/Scrips
/Components/CarBoxComponent'
;
import
{
CarColorsGlobalInstance
}
from
'
..
/CarColorsGlobalInstance'
;
import
{
CarColorsGlobalInstance
}
from
'
db://assets/CarColorsGame/Scrips
/CarColorsGlobalInstance'
;
import
{
Label3D
}
from
'
../../..
/ScriptFrame/Frame/label-3d'
;
import
{
Label3D
}
from
'
db://assets
/ScriptFrame/Frame/label-3d'
;
const
{
ccclass
,
property
}
=
_decorator
;
const
{
ccclass
,
property
}
=
_decorator
;
...
...
assets/
CarColorsGame/Scrips
/Systerms/CarCarColorsSysterm.ts.meta
→
assets/
Scripts/Scenes/MainGame
/Systerms/CarCarColorsSysterm.ts.meta
View file @
7c5a77b7
File moved
assets/
CarColorsGame/Scrips
/Systerms/RoleCarColorsSysterm.ts
→
assets/
Scripts/Scenes/MainGame
/Systerms/RoleCarColorsSysterm.ts
View file @
7c5a77b7
...
@@ -12,10 +12,10 @@ import {
...
@@ -12,10 +12,10 @@ import {
randomRangeInt
,
randomRangeInt
,
Vec3
Vec3
}
from
'cc'
;
}
from
'cc'
;
import
{
RoleCarColorsComponent
}
from
'
..
/Components/RoleCarColorsComponent'
;
import
{
RoleCarColorsComponent
}
from
'
db://assets/CarColorsGame/Scrips
/Components/RoleCarColorsComponent'
;
import
{
CarColors
,
CarTypes
}
from
'
..
/CarColorsGlobalTypes'
;
import
{
CarColors
,
CarTypes
}
from
'
db://assets/CarColorsGame/Scrips
/CarColorsGlobalTypes'
;
import
{
CarColorsGlobalInstance
}
from
'
..
/CarColorsGlobalInstance'
;
import
{
CarColorsGlobalInstance
}
from
'
db://assets/CarColorsGame/Scrips
/CarColorsGlobalInstance'
;
import
{
CarCarColorsComponent
}
from
'
..
/Components/CarCarColorsComponent'
;
import
{
CarCarColorsComponent
}
from
'
db://assets/CarColorsGame/Scrips
/Components/CarCarColorsComponent'
;
import
{
AudioClipName
,
AudioMgr
}
from
"db://assets/core/base/AudioMgr"
;
import
{
AudioClipName
,
AudioMgr
}
from
"db://assets/core/base/AudioMgr"
;
import
{
showPanel
}
from
"db://assets/core/Module/UIFast"
;
import
{
showPanel
}
from
"db://assets/core/Module/UIFast"
;
import
{
ReviewPanel
}
from
"db://assets/Scripts/Panels/ReviewPanel"
;
import
{
ReviewPanel
}
from
"db://assets/Scripts/Panels/ReviewPanel"
;
...
@@ -62,6 +62,60 @@ export class RoleCarColorsSysterm extends Component {
...
@@ -62,6 +62,60 @@ export class RoleCarColorsSysterm extends Component {
},
1
)
},
1
)
}
}
refreshRoleLine
(){
const
points
=
find
(
"Scene/Parkings"
).
children
let
cars
:
Array
<
Node
>
=
[]
for
(
let
i
=
points
.
length
;
i
--
;){
if
(
points
[
i
].
name
===
"inuse"
&&
points
[
i
].
children
.
length
===
2
){
cars
.
push
(
points
[
i
].
children
[
1
])
}
}
let
colors
:
Array
<
CarColors
>
=
[]
for
(
let
i
=
cars
.
length
;
i
--
;){
const
car
=
cars
[
i
]
const
carComp
=
car
.
getComponent
(
CarCarColorsComponent
)
let
num
=
10
if
(
carComp
.
carType
===
CarTypes
.
Minivan
){
num
=
6
}
else
if
(
carComp
.
carType
===
CarTypes
.
Sedan
){
num
=
4
}
num
-=
carComp
.
roleNum
console
.
log
(
num
)
for
(;
num
--
;){
// console.log(num)
colors
.
push
(
carComp
.
carColor
)
}
}
console
.
log
(
colors
.
length
)
const
roles
=
find
(
"Scene/Roles"
).
children
for
(
let
i
=
0
;
i
<
colors
.
length
;
i
++
){
if
(
i
>=
roles
.
length
){
break
}
const
roleCom
=
roles
[
i
].
getComponent
(
RoleCarColorsComponent
)
if
(
roleCom
.
color
!==
colors
[
i
]){
const
colorIndex
=
CarColorsGlobalInstance
.
instance
.
carSysterm
.
carSeats
.
lastIndexOf
(
colors
[
i
])
// 存量未找到,从队列中找
if
(
colorIndex
===
-
1
){
for
(
let
j
=
roles
.
length
;
j
--
;){
if
(
roles
[
j
].
getComponent
(
RoleCarColorsComponent
).
color
===
colors
[
i
]){
roles
[
j
].
getComponent
(
RoleCarColorsComponent
).
color
=
roleCom
.
color
break
}
}
}
else
{
CarColorsGlobalInstance
.
instance
.
carSysterm
.
carSeats
[
colorIndex
]
=
roleCom
.
color
}
roleCom
.
color
=
colors
[
i
]
}
}
this
.
isGaming
=
true
}
addRoleToLine
()
{
addRoleToLine
()
{
const
rolesNode
=
find
(
"Scene/Roles"
)
const
rolesNode
=
find
(
"Scene/Roles"
)
...
...
assets/
CarColorsGame/Scrips
/Systerms/RoleCarColorsSysterm.ts.meta
→
assets/
Scripts/Scenes/MainGame
/Systerms/RoleCarColorsSysterm.ts.meta
View file @
7c5a77b7
File moved
assets/Scripts/store/gameStore.ts
View file @
7c5a77b7
import
mobx
from
"mobx"
;
import
mobx
from
"mobx"
;
import
store
from
"db://assets/Scripts/store/store"
;
import
store
from
"db://assets/Scripts/store/store"
;
import
{
creditsCost
,
sendWebNet
,
WebNetName
}
from
"db://assets/Scripts/Utils/WebNet/WebNet"
;
import
{
creditsCost
,
sendWebNet
,
WebNetName
}
from
"db://assets/Scripts/Utils/WebNet/WebNet"
;
import
{
showPanel
}
from
"db://assets/core/Module/UIFast"
;
import
{
SucPanel
}
from
"db://assets/Scripts/Panels/SucPanel"
;
import
{
OverPanel
}
from
"db://assets/Scripts/Panels/OverPanel"
;
const
{
makeAutoObservable
}
=
mobx
;
const
{
makeAutoObservable
}
=
mobx
;
...
@@ -23,7 +26,7 @@ class GameStore {
...
@@ -23,7 +26,7 @@ class GameStore {
const
params
:
{
ticketNum
?:
string
}
=
{};
const
params
:
{
ticketNum
?:
string
}
=
{};
if
(
freeTimes
<=
0
)
{
if
(
freeTimes
<=
0
)
{
const
{
success
,
ticket
}
=
await
creditsCost
(
"
toPlaywayId"
,
"toPlaywayName"
,
"wany
"
,
gameCreditsEach
);
const
{
success
,
ticket
}
=
await
creditsCost
(
"
main"
,
"start"
,
"deduct_credits_desc
"
,
gameCreditsEach
);
if
(
!
success
)
return
false
;
if
(
!
success
)
return
false
;
params
.
ticketNum
=
ticket
;
params
.
ticketNum
=
ticket
;
}
}
...
@@ -62,8 +65,6 @@ class GameStore {
...
@@ -62,8 +65,6 @@ class GameStore {
});
});
if
(
!
success
)
return
false
;
if
(
!
success
)
return
false
;
this
.
startInfo
=
data
;
}
}
async
submit
(
suc
:
boolean
)
{
async
submit
(
suc
:
boolean
)
{
...
@@ -77,7 +78,11 @@ class GameStore {
...
@@ -77,7 +78,11 @@ class GameStore {
if
(
!
success
)
return
false
;
if
(
!
success
)
return
false
;
this
.
startInfo
=
data
;
if
(
data
.
boxNum
)
{
showPanel
(
SucPanel
,
data
);
}
else
{
showPanel
(
OverPanel
,
data
);
}
}
}
}
}
...
...
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