Skip to content

Game.TransformState

Assembly:
Defined in the game's code assembly (commonly Assembly-CSharp.dll for Cities: Skylines 2 mods).
This enum is part of the game's runtime code and is used by object/transform controllers.

Namespace: Game.Objects

Type: enum

Base: byte (underlying System.Enum with an explicit underlying type of byte)

Summary:
TransformState is a small, byte-backed enumeration that represents discrete lifecycle or motion states for game objects' transforms (position/rotation/scale). It is typically used by object controllers, animation/transition systems, or state machines to describe whether an object is idle, moving, starting/ending a motion, performing an action, or finished. Values are implicitly assigned sequential byte values starting at 0.


Fields

  • Default
    Represents the default/uninitialized state (implicitly 0). Often used when no specific behavior is active.

  • Idle
    Represents a stationary or waiting state (implicitly 1). The object is present but not actively moving or performing an action.

  • Move
    Represents an active movement state (implicitly 2). The transform is being translated or animated.

  • Start
    Represents the beginning phase of a transition or animation (implicitly 3). Can be used to trigger setup logic for motion.

  • End
    Represents the ending phase of a transition or animation (implicitly 4). Can be used to trigger cleanup or finalization logic.

  • Action
    Represents that the object is performing an action (implicitly 5), e.g., interacting, animating a specific behavior distinct from simple movement.

  • Done
    Represents a finished/terminal state (implicitly 6). The object has completed its activity and will typically be considered inactive.

Properties

  • None declared on this enum.
    Note: standard enum-related helper methods from System.Enum are available (ToString, GetValues, Parse, TryParse, etc.).

Constructors

  • Enums do not declare constructors in source. Instances are created using enum literals or by casting from integral values, e.g.:
  • TransformState state = TransformState.Move;
  • TransformState state = (TransformState)2;

Methods

  • No instance methods are declared in this file.
    Inherited methods available from System.Enum / System.ValueType include:
  • ToString()
  • static Parse/TryParse
  • static GetValues/GetNames
  • Equals/GetHashCode

Usage Example

using Game.Objects;

public void UpdateObject(TransformState state)
{
    switch (state)
    {
        case TransformState.Default:
            // initialization fallback
            break;
        case TransformState.Idle:
            // keep object stationary
            break;
        case TransformState.Move:
            // update position/velocity
            break;
        case TransformState.Start:
            // prepare animation or transition
            break;
        case TransformState.End:
            // finalize transition
            break;
        case TransformState.Action:
            // perform specific action/interaction
            break;
        case TransformState.Done:
            // mark as completed, disable further updates
            break;
    }
}

// Casting to/from the underlying byte
TransformState s = TransformState.Move;
byte raw = (byte)s;          // 2
s = (TransformState)raw;     // back to Move

Additional notes: - Because the enum is byte-backed, it is compact for storage/serialization and useful when saving per-instance state for many objects. - When modding, follow existing game conventions for state transitions (e.g., order of Start -> Move/Action -> End -> Done) to remain compatible with in-game systems.