Car Prefab Creator =====
From the Unity toolbar, open Car Prefab Creator.
Spirit604/CityEditor/Car Prefab Creator
Drag & drop source cars from scene or project to Prefabs field depends on Prefab Source Type parameter.
Configure the
Common settings <carPrefabCreatorCommonSettings>
for creating a car.If the vehicle is the
Simple vehicle <simplePhysicsVehicle>
type, enable Add wheel offset in theCommon settings <carPrefabCreatorCommonSettings>
tab.Custom physics entity <customPhysicsVehicle>
shape result exampleSimple physics entity <simplePhysicsVehicle>
shape result exampleConfigure the
Save settings <carPrefabCreatorSaveSettings>
for creating a car.- Change the
Template settings <carPrefabCreatorTemplateSettings>
depending on the name of the car body (if it is a child) and the pattern of the names of the wheels. - Click Scan button.
Open
Additional Settings <carPrefabCreatorAdditionalSettings>
tab, adjust common settings for all vehicles.After, open
Prefab Info <carPrefabCreatorPrefabInfo>
tab, adjust unique settings for each vehicle.- Once all the settings have been customised, click Create to create the prefabs.
- Prefab source type:
- Scene
- Targets prefab parent : prefabs will be taken from the selected root from the scene.
- Project
- Prefabs : selected prefabs from the project.
- Car type:
- Traffic : prefab car will be created for the traffic.
- Player : prefab car will be created for the player.
Vehicle data collection : reference to the
collection <vehicleCollection>
of all vehicles.Traffic car convert template : template which contains traffic prefab template.
Player car convert template : template which contains player prefab template.
- Assign hull mesh: should find the hull of the car.
- Parent is hull mesh : car root contains a car mesh.
Has wheels : should search for wheels on a
template <carPrefabCreatorTemplateSettings>
.- Has navmesh obstacle: does the car contain NavMeshObstacle component.
- Move threshold
- Carve stationary
- Carve time to stationary
- Add offset: offset of the vehicle hull along the Y axis.
- Fix pivot : fixes the pivot point if the pivot point is in the centre of the mesh.
- Add wheel offset : adds wheel offset size.
- Local offset : custom offset value.
- Save to exist preset:
- Scene: add the created prefabs to an existing
preset <trafficPreset>
in the scene. - Selected: add the created prefabs to selected
preset <trafficPreset>
.
- Scene: add the created prefabs to an existing
- New preset settings:
- Assign new preset to scene :
preset <trafficPreset>
will replace an existingpreset <trafficPreset>
on scene. - New preset path : project path where to create a new
preset <trafficPreset>
. - New preset name : new
preset <trafficPreset>
name.
- Assign new preset to scene :
entity type of the vehicle <trafficCarSettings>
.- Prefab save type:
- Override source : selected prefabs will be replaced by new ones.
- Create new if not exist : new prefabs will be created only if there are no previously created ones by the selected path.
- Override target : previously created prefabs will be overwritten in case of a duplicate.
- Prefab save path type:
- Original prefab path : prefabs will be created in the directory where the selected prefabs are located.
- Template prefab path : Prefabs will be created in the directory where the template is located.
- Custom path : user's path of creation.
- Collection edit type:
- Add to exist : add vehicles to exist
vehicle collection <vehicleCollection>
. - Override : overrides
vehicle collection <vehicleCollection>
by created vehicles.
- Add to exist : add vehicles to exist
- Material type:
- Source : material is copied from the source prefab.
- Custom atlas material : user's custom atlas material.
- New unique material : new material is generated based on the user's own material.
Template Settings ----------------
- Wheel name templates : keyword phrases for automatic wheels searches.
- Wheel FR : forward right wheel.
- Wheel FL : forward left wheel.
- Wheel BR : backward right wheel.
- Wheel BL : backward left wheel.
- Wheel Middle : additional wheels.
Show additional settings : on/off display of the additional settings of the prefab on the Prefab Info tab.
Show custom settings : on/off display of the custom settings of the prefab on the Prefab Info tab.
Additional Settings ----------------
Common Settings ~~~~~~~~~~~~
Wheel offset : wheel offset by Y-axis of the vehicle.
Suspension length : suspension length of the vehicle. [Custom physics vehicles only]
Note
* Editing additional parameters will affect all cars in the
Prefab Info <carPrefabCreatorPrefabInfo>
tab, to make unique parameters check the toolbox opposite on the parameter in thePrefab Info <carPrefabCreatorPrefabInfo>
. * Arrow-button applies the setting for the selected parameter.
Center offset : center offset of physics shape.
Center of mass : center of mass of the vehicle.
Bevel radius : bevel radius of physics shape.
Mass : mass of the vehicle.
- Wheel source type:
- Model unique : the wheels remain as in the original model.
- Shared from model : the wheel model selected by the user from the original model is used for all wheels.
- Shared all : the wheel model selected by the user shared between all wheels.
- Wheel rotation type [shared wheel only]:
- Source : the wheel rotation remains unchanged.
- Flip left row : rotate the wheel in the left-hand row by 180° if you are using the wheel model from the right-hand row.
- Flip right row : rotate the wheel in the right-hand row by 180° if you are using the wheel model from the left-hand row.
- Has lods: on/off LODs for vehicle.
- Lod 0, 1, 2 screen size : screen size of LOD.
Note
Wheel sharing is useful for using the same wheel model for all wheels to reduce drawcalls.
- Prefab : reference to source prefab.
- Name : user's
name <carModel>
of the vehicle. - ID : new
ID <trafficId>
entry forvehicle collection <vehicleCollection>
. - Traffic group :
traffic group <pathTrafficGroup>
of the vehicle. - Override entity type : new
entity type <trafficCarSettings>
for selected vehicle (might be useful for specific vehicles such as tram). - Entity type
- Override entity type : new
- Public transport : on/off
public transport <trafficPublic>
feature. (Settings <trafficPublicAuthoring>
) - Predefined road
- Capacity
- Entries
- Public transport : on/off
- Settings type:
- New : user-defined settings.
- Template : vehicle settings are copied from the selected template [custom physics vehicle only].
- Clone model : vehicle settings are copied from the selected CarModel in the list.
- Wheel radius : wheel radius. (can be unique value)
- Wheel offset : wheel offset by Y-axis of the vehicle. (can be unique value)
- Suspension length : suspension length of the vehicle. (can be unique value) [Custom physics vehicles only]
Create : create new entity prefabs based on the added prefabs.