Skip to content

Game.Prefabs.AreaSubObjectInfo

Assembly:
Assembly-CSharp (typical for Cities: Skylines 2 mods; the class is defined in the game's runtime assembly)
Namespace:
Game.Prefabs

Type:
class

Base:
System.Object

Summary:
Serializable container used to describe a single sub-object (a prefab reference) used inside an area-type prefab. It holds a reference to an ObjectPrefab and a flag that typically controls placement behavior (for example whether the sub-object should be placed on the border of an area). This structure is commonly used when defining compound prefabs made of multiple sub-objects.


Fields

  • public ObjectPrefab m_Object
    Reference to the sub-object's prefab. This should point to a valid ObjectPrefab instance (for example a building/prop prefab). When creating or editing area prefabs, assign the desired prefab here so the game knows which object to place as part of the area.

  • public bool m_BorderPlacement
    Flag indicating whether this sub-object should be placed on the border of the area (true) or as an inner element (false). Interpretation may vary by the code that consumes this class, but generally used to decide placement rules when the area is populated.

Properties

  • This class exposes no properties; it only contains public fields.

Constructors

  • public AreaSubObjectInfo()
    Default parameterless constructor. The class is marked [Serializable], so instances are typically created and populated by prefab editors, asset serialization, or by mod code at runtime.

Methods

  • This class defines no methods.

Usage Example

// Create a new AreaSubObjectInfo and assign fields.
// Assume you obtained an ObjectPrefab reference (prefab) from the game's prefab collection.
var subInfo = new Game.Prefabs.AreaSubObjectInfo();
subInfo.m_Object = prefab;           // prefab is an ObjectPrefab instance
subInfo.m_BorderPlacement = true;    // place this sub-object on area borders

// Example: add to a list of sub-objects for an area prefab
var areaSubObjects = new List<Game.Prefabs.AreaSubObjectInfo>();
areaSubObjects.Add(subInfo);

Additional notes: - The class is marked with [Serializable], so it will be included in Unity/game serialization (useful for saving assets or exposing in editors). - Ensure m_Object points to a valid ObjectPrefab before runtime placement; invalid references will prevent the sub-object from being instantiated.