TuningPart
public sealed class TuningPartNamespace Chassis.Api
Added in 1.3.0
One tuning part: a visual piece (spoiler, bumper, rims), a performance upgrade (engine, brakes), or both. Register it on every peer with ChassisApi.RegisterTuningPart; a car carries at most one part per Slot.
Fields
Section titled “Fields”public string IdAdded in 1.3.0
Unique id, saved with the car. Lower case with a mod prefix, e.g. “mymod_gtwing”.
public string SlotAdded in 1.3.0
The slot the part goes into: wheels, spoiler, bumper_front, bumper_rear, skirts, hood, grille, exhaust, roof, fenders, cage, engine, brakes, transmission, suspension, turbo, tyres, or a slot of your own.
public string LabelAdded in 1.3.0
Name for menus.
public int PriceAdded in 1.3.0
Price for a shop. Chassis does not charge it.
public Func<LandVehicle, GameObject> BuildAdded in 1.3.0
Makes the part’s model; Chassis parents it to the car and places it with the car’s PartFit. Null for a part that only changes how the car drives. Renderer materials whose name starts with “paint”, “paint2” or “rim” take the car’s paint, second paint or rim colour. A “wheels” part gives one rim facing +X; Chassis puts a copy on every wheel, scaled to the stock rim.
public TuningStats StatsType: TuningStats
Added in 1.3.0
How the part changes driving. Null for a part that only looks different.
public Dictionary<string, PartFit> FitsType: PartFit
Added in 1.3.0
Placement per vehicle code. A part with a Build fits only the codes listed here, except a “wheels” part, which fits every car. A part without a model and with no entries fits every car.
Methods
Section titled “Methods”FitsCode
Section titled “FitsCode”public bool FitsCode(string code)Added in 1.3.0
Whether this part goes on cars of this code.
FitFor
Section titled “FitFor”public PartFit FitFor(string code)Types: PartFit
Added in 1.3.0
The placement on cars of this code, or null.