State Settings
- Each vehicle contains multiple
VehicleComponents, such asEngineComponentorGroundDetectionComponent. This includes the modules. Each of theVehicleComponentscan have a LOD setting and can be Disabled/Enabled. StateSettingsis aScriptableObjectcontaining info about LODs and Enabled/Disabled state of eachVehicleComponent. The aim ofStateSettingsis to prevent having to set the state of eachVehicleComponenton eachVehicleControllerindividually.- The
StateSettingscan be assigned through the Settings tab ofVehicleController.
For more info about VehicleComponents and their states and LODs check VehicleComponent page.
LODs
- LODs can be set through the StateSettings ScriptableObject.
- If the component has a LOD set (
lodIndex >= 0) a piece of code is run each frame to check if thelodIndexof the component is less or equal to theVehicleController'sactiveLodIndex.
- If
lodIndexis less or equal toactiveLodIndexthe component will be enabled, otherwise disabled.
- When LOD system is active it overrides the
ENABLEDbutton for that component and enables/disables the component based on LOD settings and the distance from the camera.
State Definitions
- Each
VehicleComponentloads state fromStateSettings. This is only done once, on vehicle initialization, so theStateSettingscan also be thought of as initial vehicle component state settings.
