Commit e99ddb39 authored by haiyoucuv's avatar haiyoucuv

init

parent 2972f601
...@@ -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
} }
}, },
{ {
......
{"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
...@@ -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": 1366 "triangleCount": 1356
}, },
"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": [
......
...@@ -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": "none", "mipfilter": "nearest",
"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-frame", "type": "texture",
"hasAlpha": false, "hasAlpha": false,
"fixAlphaTransparencyArtifacts": false, "fixAlphaTransparencyArtifacts": false,
"redirect": "c193315b-621b-4f68-85fb-e8abcc65bddc@6c48a" "redirect": "c193315b-621b-4f68-85fb-e8abcc65bddc@6c48a"
......
...@@ -54,8 +54,8 @@ ...@@ -54,8 +54,8 @@
"magfilter": "linear", "magfilter": "linear",
"mipfilter": "linear", "mipfilter": "linear",
"anisotropy": 0, "anisotropy": 0,
"isUuid": false, "isUuid": true,
"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"
} }
], ],
......
...@@ -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": "none", "mipfilter": "nearest",
"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-frame", "type": "texture",
"hasAlpha": false, "hasAlpha": false,
"fixAlphaTransparencyArtifacts": false, "fixAlphaTransparencyArtifacts": false,
"redirect": "6b3afa2f-f34c-44b7-9297-59f20d9ceb91@6c48a" "redirect": "6b3afa2f-f34c-44b7-9297-59f20d9ceb91@6c48a"
......
This diff is collapsed.
...@@ -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__": 122 "__id__": 126
} }
}, },
{ {
...@@ -2281,7 +2327,7 @@ ...@@ -2281,7 +2327,7 @@
"__id__": 2 "__id__": 2
}, },
"targetInfo": { "targetInfo": {
"__id__": 124 "__id__": 128
} }
}, },
{ {
......
...@@ -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.95, 0.95, 0.95) }) .to(0.2, { scale: new Vec3(0.96, 0.96, 0.96) })
.start(); .start();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment