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
e99ddb39
Commit
e99ddb39
authored
Jun 05, 2025
by
haiyoucuv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
init
parent
2972f601
Changes
12
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
4402 additions
and
2947 deletions
+4402
-2947
level1.prefab
assets/Bundles/MainGame/Levels/level1.prefab
+2
-2
level2.prefab
assets/Bundles/MainGame/Levels/level2.prefab
+1445
-997
level3.prefab
assets/Bundles/MainGame/Levels/level3.prefab
+2631
-1509
Veh_Sedan_01.bin
assets/Bundles/MainGame/model/Veh_Sedan_01/Veh_Sedan_01.bin
+0
-0
Veh_Sedan_01.gltf
assets/Bundles/MainGame/model/Veh_Sedan_01/Veh_Sedan_01.gltf
+1
-1
Veh_Sedan_01.gltf.meta
...undles/MainGame/model/Veh_Sedan_01/Veh_Sedan_01.gltf.meta
+19
-2
city_vehicles_pallete.jpg.meta
...ainGame/model/Veh_Sedan_01/city_vehicles_pallete.jpg.meta
+4
-96
bus_big_bule.gltf.meta
assets/Bundles/MainGame/model/bus/bus_big_bule.gltf.meta
+3
-2
city_vehicles_pallete.jpg.meta
...Bundles/MainGame/model/bus/city_vehicles_pallete.jpg.meta
+4
-96
Car4.prefab
assets/Bundles/MainGame/prefab/Car4.prefab
+239
-236
Car6.prefab
assets/Bundles/MainGame/prefab/Car6.prefab
+48
-2
CarCarColorsComponent.ts
...ripts/Scenes/MainGame/Components/CarCarColorsComponent.ts
+6
-4
No files found.
assets/Bundles/MainGame/Levels/level1.prefab
View file @
e99ddb39
...
@@ -333,9 +333,9 @@
...
@@ -333,9 +333,9 @@
],
],
"value": {
"value": {
"__type__": "cc.Vec3",
"__type__": "cc.Vec3",
"x": -1.
446
,
"x": -1.
618
,
"y": 0,
"y": 0,
"z": -1.
446
"z": -1.
618
}
}
},
},
{
{
...
...
assets/Bundles/MainGame/Levels/level2.prefab
View file @
e99ddb39
This diff is collapsed.
Click to expand it.
assets/Bundles/MainGame/Levels/level3.prefab
View file @
e99ddb39
This diff is collapsed.
Click to expand it.
assets/Bundles/MainGame/model/Veh_Sedan_01/Veh_Sedan_01.bin
View file @
e99ddb39
No preview for this file type
assets/Bundles/MainGame/model/Veh_Sedan_01/Veh_Sedan_01.gltf
View file @
e99ddb39
{"asset":{"version":"2.0","generator":"babylon.js glTF exporter for Autodesk MAYA 2022 v20220628.1"},"scene":0,"scenes":[{"nodes":[0]}],"nodes":[{"children":[1],"mesh":0,"name":"Veh_Sedan_01"},{"mesh":1,"name":"top"}],"meshes":[{"primitives":[{"attributes":{"POSITION":1,"TANGENT":2,"NORMAL":3,"TEXCOORD_0":4},"indices":0,"material":0}],"name":"Veh_Sedan_01"},{"primitives":[{"attributes":{"POSITION":6,"TANGENT":7,"NORMAL":8,"TEXCOORD_0":9},"indices":5,"material":0}],"name":"top"}],"accessors":[{"bufferView":0,"componentType":5123,"count":4098,"type":"SCALAR","name":"accessorIndices"},{"bufferView":1,"componentType":5126,"count":1089,"max":[0.100601807,0.1400902,0.232108772],"min":[-0.100601807,0.01729396,-0.236969948],"type":"VEC3","name":"accessorPositions"},{"bufferView":2,"componentType":5126,"count":1089,"type":"VEC4","name":"accessorTangents"},{"bufferView":1,"byteOffset":13068,"componentType":5126,"count":1089,"type":"VEC3","name":"accessorNormals"},{"bufferView":3,"componentType":5126,"count":1089,"type":"VEC2","name":"accessorUVs"},{"bufferView":0,"byteOffset":8196,"componentType":5123,"count":48,"type":"SCALAR","name":"accessorIndices"},{"bufferView":1,"byteOffset":26136,"componentType":5126,"count":15,"max":[0.0566301681,0.142031014,0.03105983],"min":[-0.0566301681,0.130170673,-0.1248754],"type":"VEC3","name":"accessorPositions"},{"bufferView":2,"byteOffset":17424,"componentType":5126,"count":15,"type":"VEC4","name":"accessorTangents"},{"bufferView":1,"byteOffset":26316,"componentType":5126,"count":15,"type":"VEC3","name":"accessorNormals"},{"bufferView":3,"byteOffset":8712,"componentType":5126,"count":15,"type":"VEC2","name":"accessorUVs"}],"bufferViews":[{"buffer":0,"byteLength":8292,"name":"bufferViewScalar"},{"buffer":0,"byteOffset":8292,"byteLength":26496,"byteStride":12,"name":"bufferViewFloatVec3"},{"buffer":0,"byteOffset":34788,"byteLength":17664,"byteStride":16,"name":"bufferViewFloatVec4"},{"buffer":0,"byteOffset":52452,"byteLength":8832,"byteStride":8,"name":"bufferViewFloatVec2"}],"buffers":[{"uri":"Veh_Sedan_01.bin","byteLength":61284}],"materials":[{"pbrMetallicRoughness":{"baseColorTexture":{"index":0},"metallicFactor":0.0,"roughnessFactor":0.450053632},"name":"Material001"}],"textures":[{"sampler":0,"source":0,"name":"city_vehicles_pallete.jpg"}],"images":[{"uri":"city_vehicles_pallete.jpg"}],"samplers":[{"magFilter":9729,"minFilter":9987}]}
{"asset":{"version":"2.0","generator":"babylon.js glTF exporter for Autodesk MAYA 2022 v20220628.1"},"scene":0,"scenes":[{"nodes":[0]}],"nodes":[{"children":[1],"mesh":0,"name":"Veh_Sedan_01"},{"mesh":1,"name":"top"}],"meshes":[{"primitives":[{"attributes":{"POSITION":1,"TANGENT":2,"NORMAL":3,"TEXCOORD_0":4},"indices":0,"material":0},{"attributes":{"POSITION":6,"TANGENT":7,"NORMAL":8,"TEXCOORD_0":9},"indices":5,"material":1}],"name":"Veh_Sedan_01"},{"primitives":[{"attributes":{"POSITION":11,"TANGENT":12,"NORMAL":13,"TEXCOORD_0":14},"indices":10,"material":1}],"name":"top"}],"accessors":[{"bufferView":0,"componentType":5123,"count":915,"type":"SCALAR","name":"accessorIndices"},{"bufferView":1,"componentType":5126,"count":252,"max":[0.0842952356,0.134458154,0.2244528],"min":[-0.08429641,0.0185105335,-0.226317689],"type":"VEC3","name":"accessorPositions"},{"bufferView":2,"componentType":5126,"count":252,"type":"VEC4","name":"accessorTangents"},{"bufferView":1,"byteOffset":3024,"componentType":5126,"count":252,"type":"VEC3","name":"accessorNormals"},{"bufferView":3,"componentType":5126,"count":252,"type":"VEC2","name":"accessorUVs"},{"bufferView":0,"byteOffset":1832,"componentType":5123,"count":3153,"type":"SCALAR","name":"accessorIndices"},{"bufferView":1,"byteOffset":6048,"componentType":5126,"count":852,"max":[0.100601807,0.1400902,0.232108772],"min":[-0.100601807,0.01729396,-0.236969948],"type":"VEC3","name":"accessorPositions"},{"bufferView":2,"byteOffset":4032,"componentType":5126,"count":852,"type":"VEC4","name":"accessorTangents"},{"bufferView":1,"byteOffset":16272,"componentType":5126,"count":852,"type":"VEC3","name":"accessorNormals"},{"bufferView":3,"byteOffset":2016,"componentType":5126,"count":852,"type":"VEC2","name":"accessorUVs"},{"bufferView":0,"byteOffset":8140,"componentType":5123,"count":48,"type":"SCALAR","name":"accessorIndices"},{"bufferView":1,"byteOffset":26496,"componentType":5126,"count":15,"max":[0.0566301681,0.142031014,0.03105983],"min":[-0.0566301681,0.130170673,-0.1248754],"type":"VEC3","name":"accessorPositions"},{"bufferView":2,"byteOffset":17664,"componentType":5126,"count":15,"type":"VEC4","name":"accessorTangents"},{"bufferView":1,"byteOffset":26676,"componentType":5126,"count":15,"type":"VEC3","name":"accessorNormals"},{"bufferView":3,"byteOffset":8832,"componentType":5126,"count":15,"type":"VEC2","name":"accessorUVs"}],"bufferViews":[{"buffer":0,"byteLength":8236,"name":"bufferViewScalar"},{"buffer":0,"byteOffset":8236,"byteLength":26856,"byteStride":12,"name":"bufferViewFloatVec3"},{"buffer":0,"byteOffset":35092,"byteLength":17904,"byteStride":16,"name":"bufferViewFloatVec4"},{"buffer":0,"byteOffset":52996,"byteLength":8952,"byteStride":8,"name":"bufferViewFloatVec2"}],"buffers":[{"uri":"Veh_Sedan_01.bin","byteLength":61948}],"materials":[{"pbrMetallicRoughness":{"baseColorFactor":[0.0,0.0,0.0,1.0],"metallicFactor":0.0,"roughnessFactor":0.450053632},"name":"lambert2"},{"pbrMetallicRoughness":{"baseColorTexture":{"index":0},"metallicFactor":0.0,"roughnessFactor":0.450053632},"name":"Material001"}],"textures":[{"sampler":0,"source":0,"name":"city_vehicles_pallete.jpg"}],"images":[{"uri":"city_vehicles_pallete.jpg"}],"samplers":[{"magFilter":9729,"minFilter":9987}]}
\ No newline at end of file
\ No newline at end of file
assets/Bundles/MainGame/model/Veh_Sedan_01/Veh_Sedan_01.gltf.meta
View file @
e99ddb39
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
"name": "Veh_Sedan_01.mesh",
"name": "Veh_Sedan_01.mesh",
"userData": {
"userData": {
"gltfIndex": 0,
"gltfIndex": 0,
"triangleCount": 13
6
6
"triangleCount": 13
5
6
},
},
"ver": "1.1.1",
"ver": "1.1.1",
"imported": true,
"imported": true,
...
@@ -64,6 +64,22 @@
...
@@ -64,6 +64,22 @@
],
],
"subMetas": {}
"subMetas": {}
},
},
"7a3ca": {
"importer": "gltf-material",
"uuid": "a6c4d563-2f30-4a18-9d91-80eff8639cac@7a3ca",
"displayName": "",
"id": "7a3ca",
"name": "lambert2.material",
"userData": {
"gltfIndex": 0
},
"ver": "1.0.14",
"imported": true,
"files": [
".json"
],
"subMetas": {}
},
"ca88e": {
"ca88e": {
"importer": "gltf-material",
"importer": "gltf-material",
"uuid": "a6c4d563-2f30-4a18-9d91-80eff8639cac@ca88e",
"uuid": "a6c4d563-2f30-4a18-9d91-80eff8639cac@ca88e",
...
@@ -71,7 +87,7 @@
...
@@ -71,7 +87,7 @@
"id": "ca88e",
"id": "ca88e",
"name": "Material001.material",
"name": "Material001.material",
"userData": {
"userData": {
"gltfIndex":
0
"gltfIndex":
1
},
},
"ver": "1.0.14",
"ver": "1.0.14",
"imported": true,
"imported": true,
...
@@ -131,6 +147,7 @@
...
@@ -131,6 +147,7 @@
"a6c4d563-2f30-4a18-9d91-80eff8639cac@1d4f8"
"a6c4d563-2f30-4a18-9d91-80eff8639cac@1d4f8"
],
],
"materials": [
"materials": [
"a6c4d563-2f30-4a18-9d91-80eff8639cac@7a3ca",
"a6c4d563-2f30-4a18-9d91-80eff8639cac@ca88e"
"a6c4d563-2f30-4a18-9d91-80eff8639cac@ca88e"
],
],
"scenes": [
"scenes": [
...
...
assets/Bundles/MainGame/model/Veh_Sedan_01/city_vehicles_pallete.jpg.meta
View file @
e99ddb39
...
@@ -15,14 +15,14 @@
...
@@ -15,14 +15,14 @@
"id": "6c48a",
"id": "6c48a",
"name": "texture",
"name": "texture",
"userData": {
"userData": {
"wrapModeS": "
clamp-to-edge
",
"wrapModeS": "
repeat
",
"wrapModeT": "
clamp-to-edge
",
"wrapModeT": "
repeat
",
"imageUuidOrDatabaseUri": "c193315b-621b-4f68-85fb-e8abcc65bddc",
"imageUuidOrDatabaseUri": "c193315b-621b-4f68-85fb-e8abcc65bddc",
"isUuid": true,
"isUuid": true,
"visible": false,
"visible": false,
"minfilter": "linear",
"minfilter": "linear",
"magfilter": "linear",
"magfilter": "linear",
"mipfilter": "n
one
",
"mipfilter": "n
earest
",
"anisotropy": 0
"anisotropy": 0
},
},
"ver": "1.0.22",
"ver": "1.0.22",
...
@@ -31,102 +31,10 @@
...
@@ -31,102 +31,10 @@
".json"
".json"
],
],
"subMetas": {}
"subMetas": {}
},
"f9941": {
"importer": "sprite-frame",
"uuid": "c193315b-621b-4f68-85fb-e8abcc65bddc@f9941",
"displayName": "city_vehicles_pallete",
"id": "f9941",
"name": "spriteFrame",
"userData": {
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 256,
"height": 256,
"rawWidth": 256,
"rawHeight": 256,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"packable": true,
"pixelsToUnit": 100,
"pivotX": 0.5,
"pivotY": 0.5,
"meshType": 0,
"vertices": {
"rawPosition": [
-128,
-128,
0,
128,
-128,
0,
-128,
128,
0,
128,
128,
0
],
"indexes": [
0,
1,
2,
2,
1,
3
],
"uv": [
0,
256,
256,
256,
0,
0,
256,
0
],
"nuv": [
0,
0,
1,
0,
0,
1,
1,
1
],
"minPos": [
-128,
-128,
0
],
"maxPos": [
128,
128,
0
]
},
"isUuid": true,
"imageUuidOrDatabaseUri": "c193315b-621b-4f68-85fb-e8abcc65bddc@6c48a",
"atlasUuid": "",
"trimType": "auto"
},
"ver": "1.0.12",
"imported": true,
"files": [
".json"
],
"subMetas": {}
}
}
},
},
"userData": {
"userData": {
"type": "
sprite-fram
e",
"type": "
textur
e",
"hasAlpha": false,
"hasAlpha": false,
"fixAlphaTransparencyArtifacts": false,
"fixAlphaTransparencyArtifacts": false,
"redirect": "c193315b-621b-4f68-85fb-e8abcc65bddc@6c48a"
"redirect": "c193315b-621b-4f68-85fb-e8abcc65bddc@6c48a"
...
...
assets/Bundles/MainGame/model/bus/bus_big_bule.gltf.meta
View file @
e99ddb39
...
@@ -54,8 +54,8 @@
...
@@ -54,8 +54,8 @@
"magfilter": "linear",
"magfilter": "linear",
"mipfilter": "linear",
"mipfilter": "linear",
"anisotropy": 0,
"anisotropy": 0,
"isUuid":
fals
e,
"isUuid":
tru
e,
"imageUuidOrDatabaseUri": "
db://assets/Bundles/MainGame/model/bus/city_vehicles_pallete.jpg
"
"imageUuidOrDatabaseUri": "
6b3afa2f-f34c-44b7-9297-59f20d9ceb91
"
},
},
"ver": "1.0.22",
"ver": "1.0.22",
"imported": true,
"imported": true,
...
@@ -116,6 +116,7 @@
...
@@ -116,6 +116,7 @@
"userData": {
"userData": {
"imageMetas": [
"imageMetas": [
{
{
"remap": "6b3afa2f-f34c-44b7-9297-59f20d9ceb91",
"uri": "db://assets/Bundles/MainGame/model/bus/city_vehicles_pallete.jpg"
"uri": "db://assets/Bundles/MainGame/model/bus/city_vehicles_pallete.jpg"
}
}
],
],
...
...
assets/Bundles/MainGame/model/bus/city_vehicles_pallete.jpg.meta
View file @
e99ddb39
...
@@ -15,14 +15,14 @@
...
@@ -15,14 +15,14 @@
"id": "6c48a",
"id": "6c48a",
"name": "texture",
"name": "texture",
"userData": {
"userData": {
"wrapModeS": "
clamp-to-edge
",
"wrapModeS": "
repeat
",
"wrapModeT": "
clamp-to-edge
",
"wrapModeT": "
repeat
",
"imageUuidOrDatabaseUri": "6b3afa2f-f34c-44b7-9297-59f20d9ceb91",
"imageUuidOrDatabaseUri": "6b3afa2f-f34c-44b7-9297-59f20d9ceb91",
"isUuid": true,
"isUuid": true,
"visible": false,
"visible": false,
"minfilter": "linear",
"minfilter": "linear",
"magfilter": "linear",
"magfilter": "linear",
"mipfilter": "n
one
",
"mipfilter": "n
earest
",
"anisotropy": 0
"anisotropy": 0
},
},
"ver": "1.0.22",
"ver": "1.0.22",
...
@@ -31,102 +31,10 @@
...
@@ -31,102 +31,10 @@
".json"
".json"
],
],
"subMetas": {}
"subMetas": {}
},
"f9941": {
"importer": "sprite-frame",
"uuid": "6b3afa2f-f34c-44b7-9297-59f20d9ceb91@f9941",
"displayName": "city_vehicles_pallete",
"id": "f9941",
"name": "spriteFrame",
"userData": {
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 256,
"height": 256,
"rawWidth": 256,
"rawHeight": 256,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"packable": true,
"pixelsToUnit": 100,
"pivotX": 0.5,
"pivotY": 0.5,
"meshType": 0,
"vertices": {
"rawPosition": [
-128,
-128,
0,
128,
-128,
0,
-128,
128,
0,
128,
128,
0
],
"indexes": [
0,
1,
2,
2,
1,
3
],
"uv": [
0,
256,
256,
256,
0,
0,
256,
0
],
"nuv": [
0,
0,
1,
0,
0,
1,
1,
1
],
"minPos": [
-128,
-128,
0
],
"maxPos": [
128,
128,
0
]
},
"isUuid": true,
"imageUuidOrDatabaseUri": "6b3afa2f-f34c-44b7-9297-59f20d9ceb91@6c48a",
"atlasUuid": "",
"trimType": "auto"
},
"ver": "1.0.12",
"imported": true,
"files": [
".json"
],
"subMetas": {}
}
}
},
},
"userData": {
"userData": {
"type": "
sprite-fram
e",
"type": "
textur
e",
"hasAlpha": false,
"hasAlpha": false,
"fixAlphaTransparencyArtifacts": false,
"fixAlphaTransparencyArtifacts": false,
"redirect": "6b3afa2f-f34c-44b7-9297-59f20d9ceb91@6c48a"
"redirect": "6b3afa2f-f34c-44b7-9297-59f20d9ceb91@6c48a"
...
...
assets/Bundles/MainGame/prefab/Car4.prefab
View file @
e99ddb39
This diff is collapsed.
Click to expand it.
assets/Bundles/MainGame/prefab/Car6.prefab
View file @
e99ddb39
...
@@ -2226,6 +2226,12 @@
...
@@ -2226,6 +2226,12 @@
},
},
{
{
"__id__": 123
"__id__": 123
},
{
"__id__": 125
},
{
"__id__": 127
}
}
],
],
"nestedPrefabInstanceRoots": [
"nestedPrefabInstanceRoots": [
...
@@ -2246,6 +2252,46 @@
...
@@ -2246,6 +2252,46 @@
}
}
]
]
},
},
{
"__type__": "cc.TargetOverrideInfo",
"source": null,
"sourceInfo": null,
"propertyPath": [
"bodyMesh"
],
"target": {
"__id__": 2
},
"targetInfo": {
"__id__": 122
}
},
{
"__type__": "cc.TargetInfo",
"localID": [
"a8KAKbpytWQIj9beYfhm7E"
]
},
{
"__type__": "cc.TargetOverrideInfo",
"source": null,
"sourceInfo": null,
"propertyPath": [
"top"
],
"target": {
"__id__": 2
},
"targetInfo": {
"__id__": 124
}
},
{
"__type__": "cc.TargetInfo",
"localID": [
"49vJjWyDlSg5SO/dJHjbmh"
]
},
{
{
"__type__": "cc.TargetOverrideInfo",
"__type__": "cc.TargetOverrideInfo",
"source": {
"source": {
...
@@ -2259,7 +2305,7 @@
...
@@ -2259,7 +2305,7 @@
"__id__": 2
"__id__": 2
},
},
"targetInfo": {
"targetInfo": {
"__id__": 12
2
"__id__": 12
6
}
}
},
},
{
{
...
@@ -2281,7 +2327,7 @@
...
@@ -2281,7 +2327,7 @@
"__id__": 2
"__id__": 2
},
},
"targetInfo": {
"targetInfo": {
"__id__": 12
4
"__id__": 12
8
}
}
},
},
{
{
...
...
assets/Scripts/Scenes/MainGame/Components/CarCarColorsComponent.ts
View file @
e99ddb39
...
@@ -17,6 +17,8 @@ import { RoleCarColorsComponent } from './RoleCarColorsComponent';
...
@@ -17,6 +17,8 @@ import { RoleCarColorsComponent } from './RoleCarColorsComponent';
import
{
CarColorsGlobalInstance
}
from
'../CarColorsGlobalInstance'
;
import
{
CarColorsGlobalInstance
}
from
'../CarColorsGlobalInstance'
;
import
{
MainGame
}
from
"db://assets/Scripts/Scenes/MainGame/MainGame"
;
import
{
MainGame
}
from
"db://assets/Scripts/Scenes/MainGame/MainGame"
;
import
{
EDITOR
}
from
"cc/env"
;
const
{
ccclass
,
property
,
executeInEditMode
}
=
_decorator
;
const
{
ccclass
,
property
,
executeInEditMode
}
=
_decorator
;
@
ccclass
(
'CarCarColorsComponent'
)
@
ccclass
(
'CarCarColorsComponent'
)
...
@@ -31,6 +33,7 @@ export class CarCarColorsComponent extends Component {
...
@@ -31,6 +33,7 @@ export class CarCarColorsComponent extends Component {
}
}
set
carColor
(
value
)
{
set
carColor
(
value
)
{
if
(
this
.
_carColor
===
value
)
return
;
this
.
_carColor
=
value
;
this
.
_carColor
=
value
;
this
.
changeColor
();
this
.
changeColor
();
}
}
...
@@ -38,9 +41,7 @@ export class CarCarColorsComponent extends Component {
...
@@ -38,9 +41,7 @@ export class CarCarColorsComponent extends Component {
@
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
;
...
@@ -68,6 +69,7 @@ export class CarCarColorsComponent extends Component {
...
@@ -68,6 +69,7 @@ export class CarCarColorsComponent extends Component {
// if (!EDITOR_NOT_IN_PREVIEW){
// if (!EDITOR_NOT_IN_PREVIEW){
// this.colorMaterials = find("Scene/mtl").getComponent(MeshRenderer).sharedMaterials
// this.colorMaterials = find("Scene/mtl").getComponent(MeshRenderer).sharedMaterials
// }
// }
if
(
EDITOR
&&
this
.
bodyMesh
.
getSharedMaterial
(
1
)
==
this
.
colorMaterials
[
this
.
carColor
])
return
;
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
);
...
@@ -76,7 +78,7 @@ export class CarCarColorsComponent extends Component {
...
@@ -76,7 +78,7 @@ export class CarCarColorsComponent extends Component {
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.9
5
,
0.95
,
0.95
)
})
.
to
(
0.2
,
{
scale
:
new
Vec3
(
0.9
6
,
0.96
,
0.96
)
})
.
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