Skip to content

Game.CompositionInvertMode

Assembly: Assembly-CSharp (game runtime assembly)
Namespace: Game.Prefabs

Type: enum

Base: System.Enum

Summary:
Represents the available strategies for converting or mirroring a prefab composition to support different traffic handedness (left-hand vs right-hand) or to leave the composition unchanged. Useful when importing or placing prefabs that must be adapted to a city's traffic rules or when creating mirrored variants of asymmetrical prefabs.


Fields

  • InvertLefthandTraffic
    Switch traffic logic so the composition behaves as left-hand traffic. Typically this adjusts lane directions, traffic rules and related logic without necessarily mirroring the visual geometry.

  • FlipLefthandTraffic
    Create a mirrored (flipped) version of the composition for left-hand traffic. This usually performs a horizontal mirror of meshes/transforms so asymmetrical visual details match left-hand layouts.

  • InvertRighthandTraffic
    Switch traffic logic so the composition behaves as right-hand traffic. Opposite of InvertLefthandTraffic — adjusts lane directions and traffic rules to right-hand driving without mirroring the model.

  • FlipRighthandTraffic
    Create a mirrored (flipped) version of the composition for right-hand traffic by horizontally mirroring meshes/transforms so visual details match right-hand layouts.

  • KeepOriginal
    Do not alter traffic handedness or mirror the composition; keep the original logic and visual orientation as authored.

Properties

  • This enum type exposes no additional properties. Use the enum values directly.

Constructors

  • Enums have an implicit/default constructor provided by the runtime; no custom constructors are defined for this enum.

Methods

  • No custom methods are defined on this enum. Standard System.Enum methods (ToString, HasFlag, etc.) are available.

Usage Example

// Example: deciding how to modify a prefab composition based on a user setting
using Game.Prefabs;

public void ApplyCompositionMode(Composition composition, CompositionInvertMode mode)
{
    switch (mode)
    {
        case CompositionInvertMode.InvertLefthandTraffic:
            // adjust lane directions / traffic rules for left-hand traffic
            composition.ConvertTrafficLogic(isLeftHanded: true, mirrorVisuals: false);
            break;

        case CompositionInvertMode.FlipLefthandTraffic:
            // mirror visual geometry and adjust logic for left-hand traffic
            composition.ConvertTrafficLogic(isLeftHanded: true, mirrorVisuals: true);
            break;

        case CompositionInvertMode.InvertRighthandTraffic:
            composition.ConvertTrafficLogic(isLeftHanded: false, mirrorVisuals: false);
            break;

        case CompositionInvertMode.FlipRighthandTraffic:
            composition.ConvertTrafficLogic(isLeftHanded: false, mirrorVisuals: true);
            break;

        case CompositionInvertMode.KeepOriginal:
        default:
            // no changes
            break;
    }
}

Notes: - "Invert" typically means changing traffic logic (lane directions, signals, pathing) while leaving meshes/orientation intact. - "Flip" generally means performing a horizontal mirror of the composition's visuals and then adjusting logic as needed — useful for asymmetrical assets. - Actual implementation details (method names like ConvertTrafficLogic) will depend on the game's prefab/composition APIs; the example shows the intended usage pattern.