Skip to content

Game.Prefabs.OverlayProperties

Assembly:
Assembly-CSharp (game assembly — Cities: Skylines 2 runtime)

Namespace:
Game.Prefabs

Type:
class

Base:
ComponentBase

Summary:
Represents overlay rendering properties used by a prefab's rendering system. Exposes whether the overlay is a waterway and a texture coordinate area (Bounds2) that describes the portion of the overlay texture to use. Marked with a ComponentMenu attribute so it appears under the "Rendering/" menu and is associated with RenderPrefab.


Fields

  • public bool m_IsWaterway
    Indicates whether this overlay should be treated as a waterway overlay. Modders can use this flag to change rendering or behavior for overlays that represent waterways.

  • public Bounds2 m_TextureArea = new Bounds2(0f, 1f)
    Defines the texture coordinate area (UV range) used by the overlay. The default value covers the full normalized range (0..1). Bounds2 is from Colossal.Mathematics and is used to describe a 2D range for texture coordinates.

Properties

  • None (this class does not declare any public properties)

Constructors

  • public OverlayProperties()
    Implicit default constructor. Fields are initialized to their defaults: m_IsWaterway is false, and m_TextureArea is initialized to Bounds2(0f, 1f) as declared.

Methods

  • public override void GetArchetypeComponents(HashSet<ComponentType> components)
    Override intended to add ECS ComponentType entries required for the archetype associated with this prefab component. The implementation in this class is empty (no components added). Modders can override or modify this to register necessary ECS component types.

  • public override void GetPrefabComponents(HashSet<ComponentType> components)
    Override intended to add ECS ComponentType entries required for the prefab instance. The implementation in this class is empty. Use this to declare which Unity.Entities component types should be attached to prefabs that include this component.

Usage Example

// Example: configuring an OverlayProperties instance in code
var overlayProps = new Game.Prefabs.OverlayProperties();
overlayProps.m_IsWaterway = true;
overlayProps.m_TextureArea = new Colossal.Mathematics.Bounds2(0f, 1f); // covers full UV range

// If you need to register ECS component types for prefabs, implement them in the overrides:
// public override void GetPrefabComponents(HashSet<ComponentType> components)
// {
//     components.Add(ComponentType.ReadWrite<SomeRequiredComponent>());
// }