Game.Prefabs.CarTrailerType
Assembly: Assembly-CSharp (game code)
Namespace: Game.Prefabs
Type: enum
Base: System.Enum
Summary:
Enumeration describing the type of trailer attached to a car/vehicle prefab. Used by vehicle prefabs and AI to determine attachment style, rendering and behavior differences for vehicles that can tow or carry trailers. Useful for modding vehicle appearance/physics, spawn logic, and serialization of prefab data.
Fields
-
None
No trailer attached. The default value (0). Vehicles with this value do not spawn or render trailer attachments. -
Towbar
Trailer attached via a towbar/hitch. Represents small trailers or caravans that are towed by a hitch and typically follow the towing vehicle with a simple pivot joint. -
Semi
Semi-trailer configuration (tractor + semi-trailer). Used for articulated heavy trucks where the trailer is connected as a semi-trailer and has different handling/animation rules. -
Fixed
Fixed or permanently attached trailer/body (not detachable at runtime). Used when the trailer is considered part of the vehicle body (e.g., a single-unit vehicle with an extended rear).
Properties
- None (enum type — no properties)
Constructors
- None (enum type — uses default CLR underlying value assignments)
Methods
- None (enum type — uses default System.Enum behavior)
Usage Example
// Assigning a trailer type
Game.Prefabs.CarTrailerType trailer = Game.Prefabs.CarTrailerType.Semi;
// Checking trailer type
if (trailer == Game.Prefabs.CarTrailerType.None) {
// No trailer logic
}
// Branch behavior based on trailer type
switch (trailer) {
case Game.Prefabs.CarTrailerType.Towbar:
// Apply towbar-specific setup
break;
case Game.Prefabs.CarTrailerType.Semi:
// Apply semi-trailer-specific setup
break;
case Game.Prefabs.CarTrailerType.Fixed:
// Treat as part of the vehicle body
break;
default:
// Fallback
break;
}
{{ Notes: - Underlying integer values: None = 0, Towbar = 1, Semi = 2, Fixed = 3. - When modding, ensure any new vehicle prefabs referencing this enum are handled by your AI/renderer code to avoid mismatches. - This enum is simple and intended to be used as part of prefab/vehicle definitions and runtime checks — it does not itself implement behavior. }}