Skip to content

Game.AttachedObjectType

Assembly: Assembly-CSharp
Namespace: Game.Prefabs

Type: enum

Base: System.Enum

Summary:
Represents how an attached object (part of a prefab) is positioned relative to surfaces. Used by prefab/placement logic to determine attachment orientation and placement rules for objects that are not standalone (for example props or components that attach to terrain, walls, or hang from ceilings).


Fields

  • Ground
    Indicates the object is attached to the ground or terrain surface. Placement logic should treat this as a floor-level attachment.

  • Wall
    Indicates the object is attached to a vertical surface (wall). Placement logic should align the object to a vertical plane and apply wall-specific constraints.

  • Hanging
    Indicates the object is hanging (e.g., from a ceiling or overhang). Placement logic should position the object suspended from above.

Properties

  • This enum type has no properties.

Constructors

  • This enum type has no explicit constructors. Enum values are the defined named constants.

Methods

  • This enum type defines no methods beyond the implicit System.Enum methods (e.g., ToString, HasFlag) inherited from System.Enum / System.ValueType.

Usage Example

// Example: switch on attachment type when placing or validating a prefab part
void PlaceAttachedObject(AttachedObjectType type)
{
    switch (type)
    {
        case AttachedObjectType.Ground:
            // align to terrain normal, snap to ground
            break;
        case AttachedObjectType.Wall:
            // align to wall normal, apply vertical offset
            break;
        case AttachedObjectType.Hanging:
            // position under ceiling, apply hanging constraints
            break;
    }
}

// Example: storing attachment type on a prefab component
public class AttachedObjectComponent
{
    public AttachedObjectType Attachment { get; set; } = AttachedObjectType.Ground;
}