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
2972f601
Commit
2972f601
authored
Jun 05, 2025
by
haiyoucuv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
init
parent
db2d8dc5
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
543 additions
and
274 deletions
+543
-274
level1.prefab
assets/Bundles/MainGame/Levels/level1.prefab
+132
-83
Veh_Sedan_01.gltf.meta
...undles/MainGame/model/Veh_Sedan_01/Veh_Sedan_01.gltf.meta
+1
-1
Car4.prefab
assets/Bundles/MainGame/prefab/Car4.prefab
+363
-143
CarCarColorsComponent.ts
...ripts/Scenes/MainGame/Components/CarCarColorsComponent.ts
+47
-47
No files found.
assets/Bundles/MainGame/Levels/level1.prefab
View file @
2972f601
...
@@ -25,16 +25,16 @@
...
@@ -25,16 +25,16 @@
"__id__": 17
"__id__": 17
},
},
{
{
"__id__": 3
4
"__id__": 3
2
},
},
{
{
"__id__": 4
9
"__id__": 4
7
}
}
],
],
"_active": true,
"_active": true,
"_components": [],
"_components": [],
"_prefab": {
"_prefab": {
"__id__": 6
6
"__id__": 6
4
},
},
"_lpos": {
"_lpos": {
"__type__": "cc.Vec3",
"__type__": "cc.Vec3",
...
@@ -264,7 +264,7 @@
...
@@ -264,7 +264,7 @@
"__id__": 17
"__id__": 17
},
},
"asset": {
"asset": {
"__uuid__": "
1d050780-084a-4a94-89dc-105ed985a981
",
"__uuid__": "
dd50f117-884d-42a5-af5a-a80c6271db0d
",
"__expectedType__": "cc.Prefab"
"__expectedType__": "cc.Prefab"
},
},
"fileId": "ca6ZXggr1OPpZ1elxoE4VX",
"fileId": "ca6ZXggr1OPpZ1elxoE4VX",
...
@@ -273,16 +273,16 @@
...
@@ -273,16 +273,16 @@
},
},
"targetOverrides": [
"targetOverrides": [
{
{
"__id__": 2
9
"__id__": 2
7
},
},
{
{
"__id__": 3
2
"__id__": 3
0
}
}
]
]
},
},
{
{
"__type__": "cc.PrefabInstance",
"__type__": "cc.PrefabInstance",
"fileId": "
aae/c2DrxJOLchCPcaOgVX
",
"fileId": "
19yIasO0NAn4hLhfOFP3tK
",
"prefabRootNode": {
"prefabRootNode": {
"__id__": 1
"__id__": 1
},
},
...
@@ -303,9 +303,6 @@
...
@@ -303,9 +303,6 @@
},
},
{
{
"__id__": 25
"__id__": 25
},
{
"__id__": 27
}
}
],
],
"removedComponents": []
"removedComponents": []
...
@@ -318,7 +315,7 @@
...
@@ -318,7 +315,7 @@
"propertyPath": [
"propertyPath": [
"_name"
"_name"
],
],
"value": "
Sedan
"
"value": "
Car4
"
},
},
{
{
"__type__": "cc.TargetInfo",
"__type__": "cc.TargetInfo",
...
@@ -336,9 +333,9 @@
...
@@ -336,9 +333,9 @@
],
],
"value": {
"value": {
"__type__": "cc.Vec3",
"__type__": "cc.Vec3",
"x": -1.
2899999618530273
,
"x": -1.
446
,
"y":
1.4901161415892261e-9
,
"y":
0
,
"z": -1.
2900018692016602
"z": -1.
446
}
}
},
},
{
{
...
@@ -352,9 +349,9 @@
...
@@ -352,9 +349,9 @@
"value": {
"value": {
"__type__": "cc.Quat",
"__type__": "cc.Quat",
"x": 0,
"x": 0,
"y": 0.9238795
042037964
,
"y": 0.9238795
302952961
,
"z": 0,
"z": 0,
"w": -0.382683
3963394165
"w": -0.382683
4377149643
}
}
},
},
{
{
...
@@ -368,7 +365,7 @@
...
@@ -368,7 +365,7 @@
"value": {
"value": {
"__type__": "cc.Vec3",
"__type__": "cc.Vec3",
"x": 0,
"x": 0,
"y": -134.9999993364389
5
,
"y": -134.9999993364389
8
,
"z": 0
"z": 0
}
}
},
},
...
@@ -388,23 +385,6 @@
...
@@ -388,23 +385,6 @@
"6cFLC99U1Dl405ygHuNfbi"
"6cFLC99U1Dl405ygHuNfbi"
]
]
},
},
{
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"__id__": 28
},
"propertyPath": [
"_active"
],
"value": true
},
{
"__type__": "cc.TargetInfo",
"localID": [
"ebXDWV+WtBwbX0k+wUYtEb",
"a8lysz3G9WsJw3sNfEgO5Z"
]
},
{
{
"__type__": "cc.TargetOverrideInfo",
"__type__": "cc.TargetOverrideInfo",
"source": null,
"source": null,
...
@@ -413,10 +393,10 @@
...
@@ -413,10 +393,10 @@
"bodyMesh"
"bodyMesh"
],
],
"target": {
"target": {
"__id__":
30
"__id__":
28
},
},
"targetInfo": {
"targetInfo": {
"__id__":
31
"__id__":
29
}
}
},
},
{
{
...
@@ -426,7 +406,7 @@
...
@@ -426,7 +406,7 @@
{
{
"__type__": "cc.TargetInfo",
"__type__": "cc.TargetInfo",
"localID": [
"localID": [
"a
8KAKbpytWQIj9beYfhm7E
"
"a
0jw0F0+Rb0ob933IpHVaW
"
]
]
},
},
{
{
...
@@ -437,16 +417,16 @@
...
@@ -437,16 +417,16 @@
"top"
"top"
],
],
"target": {
"target": {
"__id__":
30
"__id__":
28
},
},
"targetInfo": {
"targetInfo": {
"__id__": 3
3
"__id__": 3
1
}
}
},
},
{
{
"__type__": "cc.TargetInfo",
"__type__": "cc.TargetInfo",
"localID": [
"localID": [
"
49vJjWyDlSg5SO/dJHjbmh
"
"
3fjX4tiM9XiqeFm0MyZrGs
"
]
]
},
},
{
{
...
@@ -456,14 +436,14 @@
...
@@ -456,14 +436,14 @@
"__id__": 1
"__id__": 1
},
},
"_prefab": {
"_prefab": {
"__id__": 3
5
"__id__": 3
3
},
},
"__editorExtras__": {}
"__editorExtras__": {}
},
},
{
{
"__type__": "cc.PrefabInfo",
"__type__": "cc.PrefabInfo",
"root": {
"root": {
"__id__": 3
4
"__id__": 3
2
},
},
"asset": {
"asset": {
"__uuid__": "e9d96308-84db-4157-8abd-43bd86b1b985",
"__uuid__": "e9d96308-84db-4157-8abd-43bd86b1b985",
...
@@ -471,14 +451,14 @@
...
@@ -471,14 +451,14 @@
},
},
"fileId": "6b9c9AH31BepEFqW2vpkx7",
"fileId": "6b9c9AH31BepEFqW2vpkx7",
"instance": {
"instance": {
"__id__": 3
6
"__id__": 3
4
},
},
"targetOverrides": [
"targetOverrides": [
{
{
"__id__": 4
4
"__id__": 4
2
},
},
{
{
"__id__": 4
7
"__id__": 4
5
}
}
]
]
},
},
...
@@ -492,19 +472,19 @@
...
@@ -492,19 +472,19 @@
"mountedComponents": [],
"mountedComponents": [],
"propertyOverrides": [
"propertyOverrides": [
{
{
"__id__": 3
7
"__id__": 3
5
},
},
{
{
"__id__": 3
9
"__id__": 3
7
},
},
{
{
"__id__":
40
"__id__":
38
},
},
{
{
"__id__":
41
"__id__":
39
},
},
{
{
"__id__": 4
2
"__id__": 4
0
}
}
],
],
"removedComponents": []
"removedComponents": []
...
@@ -512,7 +492,7 @@
...
@@ -512,7 +492,7 @@
{
{
"__type__": "CCPropertyOverrideInfo",
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"targetInfo": {
"__id__": 3
8
"__id__": 3
6
},
},
"propertyPath": [
"propertyPath": [
"_name"
"_name"
...
@@ -528,7 +508,7 @@
...
@@ -528,7 +508,7 @@
{
{
"__type__": "CCPropertyOverrideInfo",
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"targetInfo": {
"__id__": 3
8
"__id__": 3
6
},
},
"propertyPath": [
"propertyPath": [
"_lpos"
"_lpos"
...
@@ -543,7 +523,7 @@
...
@@ -543,7 +523,7 @@
{
{
"__type__": "CCPropertyOverrideInfo",
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"targetInfo": {
"__id__": 3
8
"__id__": 3
6
},
},
"propertyPath": [
"propertyPath": [
"_lrot"
"_lrot"
...
@@ -559,7 +539,7 @@
...
@@ -559,7 +539,7 @@
{
{
"__type__": "CCPropertyOverrideInfo",
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"targetInfo": {
"__id__": 3
8
"__id__": 3
6
},
},
"propertyPath": [
"propertyPath": [
"_euler"
"_euler"
...
@@ -574,7 +554,7 @@
...
@@ -574,7 +554,7 @@
{
{
"__type__": "CCPropertyOverrideInfo",
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"targetInfo": {
"__id__": 4
3
"__id__": 4
1
},
},
"propertyPath": [
"propertyPath": [
"_carColor"
"_carColor"
...
@@ -595,10 +575,10 @@
...
@@ -595,10 +575,10 @@
"bodyMesh"
"bodyMesh"
],
],
"target": {
"target": {
"__id__": 4
5
"__id__": 4
3
},
},
"targetInfo": {
"targetInfo": {
"__id__": 4
6
"__id__": 4
4
}
}
},
},
{
{
...
@@ -619,10 +599,10 @@
...
@@ -619,10 +599,10 @@
"top"
"top"
],
],
"target": {
"target": {
"__id__": 4
5
"__id__": 4
3
},
},
"targetInfo": {
"targetInfo": {
"__id__": 4
8
"__id__": 4
6
}
}
},
},
{
{
...
@@ -638,14 +618,14 @@
...
@@ -638,14 +618,14 @@
"__id__": 1
"__id__": 1
},
},
"_prefab": {
"_prefab": {
"__id__":
50
"__id__":
48
},
},
"__editorExtras__": {}
"__editorExtras__": {}
},
},
{
{
"__type__": "cc.PrefabInfo",
"__type__": "cc.PrefabInfo",
"root": {
"root": {
"__id__": 4
9
"__id__": 4
7
},
},
"asset": {
"asset": {
"__uuid__": "725a11fb-b865-4f16-b582-9bf848fd6a91",
"__uuid__": "725a11fb-b865-4f16-b582-9bf848fd6a91",
...
@@ -653,14 +633,14 @@
...
@@ -653,14 +633,14 @@
},
},
"fileId": "9cEQF8XeNI/5Zo+nRAEmT8",
"fileId": "9cEQF8XeNI/5Zo+nRAEmT8",
"instance": {
"instance": {
"__id__":
51
"__id__":
49
},
},
"targetOverrides": [
"targetOverrides": [
{
{
"__id__":
61
"__id__":
59
},
},
{
{
"__id__": 6
4
"__id__": 6
2
}
}
]
]
},
},
...
@@ -674,22 +654,22 @@
...
@@ -674,22 +654,22 @@
"mountedComponents": [],
"mountedComponents": [],
"propertyOverrides": [
"propertyOverrides": [
{
{
"__id__": 5
2
"__id__": 5
0
},
},
{
{
"__id__": 5
4
"__id__": 5
2
},
},
{
{
"__id__": 5
5
"__id__": 5
3
},
},
{
{
"__id__": 5
6
"__id__": 5
4
},
},
{
{
"__id__": 5
7
"__id__": 5
5
},
},
{
{
"__id__": 5
9
"__id__": 5
7
}
}
],
],
"removedComponents": []
"removedComponents": []
...
@@ -697,7 +677,7 @@
...
@@ -697,7 +677,7 @@
{
{
"__type__": "CCPropertyOverrideInfo",
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"targetInfo": {
"__id__": 5
3
"__id__": 5
1
},
},
"propertyPath": [
"propertyPath": [
"_name"
"_name"
...
@@ -713,7 +693,7 @@
...
@@ -713,7 +693,7 @@
{
{
"__type__": "CCPropertyOverrideInfo",
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"targetInfo": {
"__id__": 5
3
"__id__": 5
1
},
},
"propertyPath": [
"propertyPath": [
"_lpos"
"_lpos"
...
@@ -728,7 +708,7 @@
...
@@ -728,7 +708,7 @@
{
{
"__type__": "CCPropertyOverrideInfo",
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"targetInfo": {
"__id__": 5
3
"__id__": 5
1
},
},
"propertyPath": [
"propertyPath": [
"_lrot"
"_lrot"
...
@@ -744,7 +724,7 @@
...
@@ -744,7 +724,7 @@
{
{
"__type__": "CCPropertyOverrideInfo",
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"targetInfo": {
"__id__": 5
3
"__id__": 5
1
},
},
"propertyPath": [
"propertyPath": [
"_euler"
"_euler"
...
@@ -759,7 +739,7 @@
...
@@ -759,7 +739,7 @@
{
{
"__type__": "CCPropertyOverrideInfo",
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"targetInfo": {
"__id__": 5
8
"__id__": 5
6
},
},
"propertyPath": [
"propertyPath": [
"_carColor"
"_carColor"
...
@@ -775,7 +755,7 @@
...
@@ -775,7 +755,7 @@
{
{
"__type__": "CCPropertyOverrideInfo",
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"targetInfo": {
"__id__":
60
"__id__":
58
},
},
"propertyPath": [
"propertyPath": [
"_active"
"_active"
...
@@ -797,10 +777,10 @@
...
@@ -797,10 +777,10 @@
"bodyMesh"
"bodyMesh"
],
],
"target": {
"target": {
"__id__": 6
2
"__id__": 6
0
},
},
"targetInfo": {
"targetInfo": {
"__id__": 6
3
"__id__": 6
1
}
}
},
},
{
{
...
@@ -821,10 +801,10 @@
...
@@ -821,10 +801,10 @@
"top"
"top"
],
],
"target": {
"target": {
"__id__": 6
2
"__id__": 6
0
},
},
"targetInfo": {
"targetInfo": {
"__id__": 6
5
"__id__": 6
3
}
}
},
},
{
{
...
@@ -843,13 +823,20 @@
...
@@ -843,13 +823,20 @@
},
},
"fileId": "42Z2ckGKdDSY/taLY7VCka",
"fileId": "42Z2ckGKdDSY/taLY7VCka",
"instance": null,
"instance": null,
"targetOverrides": null,
"targetOverrides": [
{
"__id__": 65
},
{
"__id__": 68
}
],
"nestedPrefabInstanceRoots": [
"nestedPrefabInstanceRoots": [
{
{
"__id__": 4
9
"__id__": 4
7
},
},
{
{
"__id__": 3
4
"__id__": 3
2
},
},
{
{
"__id__": 17
"__id__": 17
...
@@ -858,5 +845,67 @@
...
@@ -858,5 +845,67 @@
"__id__": 2
"__id__": 2
}
}
]
]
},
{
"__type__": "cc.TargetOverrideInfo",
"source": {
"__id__": 17
},
"sourceInfo": {
"__id__": 66
},
"propertyPath": [
"bodyMesh"
],
"target": {
"__id__": 17
},
"targetInfo": {
"__id__": 67
}
},
{
"__type__": "cc.TargetInfo",
"localID": [
"6cFLC99U1Dl405ygHuNfbi"
]
},
{
"__type__": "cc.TargetInfo",
"localID": [
"cf/T5kTMtMGbZ+TffqEVBX",
"4bF5OMT+RXw6cUdkZefPcR"
]
},
{
"__type__": "cc.TargetOverrideInfo",
"source": {
"__id__": 17
},
"sourceInfo": {
"__id__": 69
},
"propertyPath": [
"top"
],
"target": {
"__id__": 17
},
"targetInfo": {
"__id__": 70
}
},
{
"__type__": "cc.TargetInfo",
"localID": [
"6cFLC99U1Dl405ygHuNfbi"
]
},
{
"__type__": "cc.TargetInfo",
"localID": [
"cf/T5kTMtMGbZ+TffqEVBX",
"fdy60pQTVT4YJabF3d41KH"
]
}
}
]
]
\ No newline at end of file
assets/Bundles/MainGame/model/Veh_Sedan_01/Veh_Sedan_01.gltf.meta
View file @
2972f601
...
@@ -137,7 +137,7 @@
...
@@ -137,7 +137,7 @@
"a6c4d563-2f30-4a18-9d91-80eff8639cac@7c4b3"
"a6c4d563-2f30-4a18-9d91-80eff8639cac@7c4b3"
]
]
},
},
"promoteSingleRootNode":
tru
e,
"promoteSingleRootNode":
fals
e,
"meshOptimize": {
"meshOptimize": {
"enable": true,
"enable": true,
"vertexCache": true,
"vertexCache": true,
...
...
assets/Bundles/MainGame/prefab/Car4.prefab
View file @
2972f601
This diff is collapsed.
Click to expand it.
assets/Scripts/Scenes/MainGame/Components/CarCarColorsComponent.ts
View file @
2972f601
...
@@ -23,45 +23,45 @@ const { ccclass, property, executeInEditMode } = _decorator;
...
@@ -23,45 +23,45 @@ const { ccclass, property, executeInEditMode } = _decorator;
@
executeInEditMode
@
executeInEditMode
export
class
CarCarColorsComponent
extends
Component
{
export
class
CarCarColorsComponent
extends
Component
{
@
property
({
type
:
Enum
(
CarTypes
)
})
@
property
({
type
:
Enum
(
CarTypes
)
})
carType
:
CarTypes
=
CarTypes
.
CAR10
carType
:
CarTypes
=
CarTypes
.
CAR10
;
@
property
({
type
:
Enum
(
CarColors
)
})
@
property
({
type
:
Enum
(
CarColors
)
})
get
carColor
()
{
get
carColor
()
{
return
this
.
_carColor
return
this
.
_carColor
;
}
}
set
carColor
(
value
)
{
set
carColor
(
value
)
{
this
.
_carColor
=
value
this
.
_carColor
=
value
;
this
.
changeColor
()
this
.
changeColor
()
;
}
}
@
property
({
type
:
Enum
(
CarColors
)
})
@
property
({
type
:
Enum
(
CarColors
)
})
private
_carColor
:
CarColors
=
CarColors
.
Purple
private
_carColor
:
CarColors
=
CarColors
.
Purple
;
@
property
({
@
property
({
type
:
[
Material
]
type
:
[
Material
]
})
})
colorMaterials
:
Array
<
Material
>
=
[]
colorMaterials
:
Array
<
Material
>
=
[]
;
@
property
(
MeshRenderer
)
bodyMesh
:
MeshRenderer
=
null
@
property
(
MeshRenderer
)
bodyMesh
:
MeshRenderer
=
null
;
@
property
(
MeshRenderer
)
top
:
MeshRenderer
=
null
@
property
(
MeshRenderer
)
top
:
MeshRenderer
=
null
;
get
sitNum
()
{
get
sitNum
()
{
return
this
.
node
.
getChildByName
(
"Seets"
).
children
.
length
;
return
this
.
node
.
getChildByName
(
"Seets"
).
children
.
length
;
}
}
halfLen
:
number
=
2
halfLen
:
number
=
2
;
roleNum
:
number
=
0
roleNum
:
number
=
0
;
isFull
:
boolean
=
false
isFull
:
boolean
=
false
;
tweenCount
=
0
tweenCount
=
0
;
onLoad
()
{
onLoad
()
{
this
.
changeColor
()
this
.
changeColor
()
;
this
.
halfLen
=
this
.
getComponent
(
BoxCollider
).
size
.
z
/
2
;
this
.
halfLen
=
this
.
getComponent
(
BoxCollider
).
size
.
z
/
2
;
this
.
roleNum
=
0
this
.
roleNum
=
0
;
this
.
isFull
=
false
this
.
isFull
=
false
;
}
}
changeColor
()
{
changeColor
()
{
...
@@ -72,12 +72,12 @@ export class CarCarColorsComponent extends Component {
...
@@ -72,12 +72,12 @@ export class CarCarColorsComponent extends Component {
this
.
bodyMesh
.
setSharedMaterial
(
this
.
colorMaterials
[
this
.
carColor
],
1
);
this
.
bodyMesh
.
setSharedMaterial
(
this
.
colorMaterials
[
this
.
carColor
],
1
);
this
.
top
.
setSharedMaterial
(
this
.
colorMaterials
[
this
.
carColor
],
this
.
top
.
materials
.
length
-
1
);
this
.
top
.
setSharedMaterial
(
this
.
colorMaterials
[
this
.
carColor
],
this
.
top
.
materials
.
length
-
1
);
this
.
node
.
getChildByName
(
"arrow"
).
active
=
true
this
.
node
.
getChildByName
(
"arrow"
).
active
=
true
;
tween
(
this
.
node
)
tween
(
this
.
node
)
.
to
(
0.2
,
{
scale
:
new
Vec3
(
1.4
,
1.4
,
1.4
)
})
.
to
(
0.2
,
{
scale
:
new
Vec3
(
1.4
,
1.4
,
1.4
)
})
.
to
(
0.2
,
{
scale
:
new
Vec3
(
0.95
,
0.95
,
0.95
)
})
.
to
(
0.2
,
{
scale
:
new
Vec3
(
0.95
,
0.95
,
0.95
)
})
.
start
()
.
start
()
;
}
}
addRole
(
role
:
Node
):
boolean
{
addRole
(
role
:
Node
):
boolean
{
...
@@ -87,38 +87,37 @@ export class CarCarColorsComponent extends Component {
...
@@ -87,38 +87,37 @@ export class CarCarColorsComponent extends Component {
tween
(
role
).
to
(
0.2
,
{
tween
(
role
).
to
(
0.2
,
{
position
:
new
Vec3
(
0
,
0
,
-
0.1
)
position
:
new
Vec3
(
0
,
0
,
-
0.1
)
}).
call
(()
=>
{
}).
call
(()
=>
{
this
.
tweenCount
-=
1
this
.
tweenCount
-=
1
;
role
.
setScale
(
0.9
,
0.9
,
0.9
)
role
.
setScale
(
0.9
,
0.9
,
0.9
)
;
role
.
setRotationFromEuler
(
0
,
0
,
0
)
role
.
setRotationFromEuler
(
0
,
0
,
0
)
;
role
.
getComponent
(
RoleCarColorsComponent
).
playSit
()
role
.
getComponent
(
RoleCarColorsComponent
).
playSit
()
;
if
(
this
.
tweenCount
<=
0
&&
this
.
isFull
)
{
if
(
this
.
tweenCount
<=
0
&&
this
.
isFull
)
{
if
(
carPoint
.
getSiblingIndex
()
===
7
)
{
if
(
carPoint
.
getSiblingIndex
()
===
7
)
{
carPoint
.
name
=
"lock"
carPoint
.
name
=
"lock"
;
carPoint
.
children
[
0
].
children
[
0
].
active
=
false
carPoint
.
children
[
0
].
children
[
0
].
active
=
false
;
carPoint
.
children
[
0
].
children
[
1
].
active
=
true
carPoint
.
children
[
0
].
children
[
1
].
active
=
true
;
}
else
{
}
else
{
carPoint
.
name
=
"empty"
carPoint
.
name
=
"empty"
;
}
}
this
.
carOutTween
(
carPoint
)
this
.
carOutTween
(
carPoint
)
;
}
}
})
}).
start
();
.
start
()
this
.
tweenCount
+=
1
this
.
tweenCount
+=
1
;
this
.
roleNum
+=
1
this
.
roleNum
+=
1
;
this
.
isFull
=
this
.
roleNum
>=
this
.
sitNum
;
this
.
isFull
=
this
.
roleNum
>=
this
.
sitNum
;
return
this
.
isFull
return
this
.
isFull
;
}
}
carOut
()
{
carOut
()
{
this
.
node
.
getChildByName
(
"Seets"
).
children
.
forEach
(
seat
=>
{
this
.
node
.
getChildByName
(
"Seets"
).
children
.
forEach
(
seat
=>
{
if
(
seat
.
children
.
length
===
0
)
return
if
(
seat
.
children
.
length
===
0
)
return
;
const
roleCom
=
seat
.
children
[
0
].
getComponent
(
RoleCarColorsComponent
)
const
roleCom
=
seat
.
children
[
0
].
getComponent
(
RoleCarColorsComponent
)
;
CarColorsGlobalInstance
.
instance
.
roleSysterm
.
clearOne
(
roleCom
)
CarColorsGlobalInstance
.
instance
.
roleSysterm
.
clearOne
(
roleCom
)
;
})
})
;
CarColorsGlobalInstance
.
instance
.
carSysterm
.
removeCar
(
this
.
node
)
CarColorsGlobalInstance
.
instance
.
carSysterm
.
removeCar
(
this
.
node
)
;
this
.
node
.
removeFromParent
()
this
.
node
.
removeFromParent
()
;
this
.
node
.
destroy
()
this
.
node
.
destroy
()
;
// console.log("carOut:", find("Scene/Levels").children.length, find("Scene/Levels").children[0].children.length, find("Scene/Roles").children.length)
// console.log("carOut:", find("Scene/Levels").children.length, find("Scene/Levels").children[0].children.length, find("Scene/Roles").children.length)
// 判定胜利
// 判定胜利
...
@@ -132,25 +131,26 @@ export class CarCarColorsComponent extends Component {
...
@@ -132,25 +131,26 @@ export class CarCarColorsComponent extends Component {
// 车离开
// 车离开
carOutTween
(
target
:
Node
)
{
carOutTween
(
target
:
Node
)
{
tween
(
this
.
node
).
to
(
0.2
,
{
tween
(
this
.
node
)
worldPosition
:
target
.
getWorldPosition
()
.
to
(
0.2
,
{
})
worldPosition
:
target
.
getWorldPosition
()
})
.
call
(()
=>
{
.
call
(()
=>
{
const
carforward
=
this
.
node
.
forward
.
clone
()
const
carforward
=
this
.
node
.
forward
.
clone
()
;
tween
(
carforward
).
to
(
0.1
,
{
x
:
-
1
,
y
:
0
,
z
:
0
},
{
tween
(
carforward
).
to
(
0.1
,
{
x
:
-
1
,
y
:
0
,
z
:
0
},
{
onUpdate
:
()
=>
{
onUpdate
:
()
=>
{
this
.
node
.
forward
=
carforward
this
.
node
.
forward
=
carforward
;
}
}
}).
start
()
}).
start
()
;
})
})
.
delay
(
0.1
)
.
delay
(
0.1
)
.
to
(
0.2
,
{
.
to
(
0.2
,
{
worldPosition
:
find
(
"Scene/physicRoodTop/rightPoint"
).
getWorldPosition
()
worldPosition
:
find
(
"Scene/physicRoodTop/rightPoint"
).
getWorldPosition
()
,
})
})
.
call
(()
=>
{
.
call
(()
=>
{
this
.
carOut
()
this
.
carOut
()
;
})
})
.
start
()
.
start
()
;
}
}
}
}
...
...
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