Skip to content

Game.Prefabs.CurveProperties

Assembly: Assembly-CSharp
Namespace: Game.Prefabs

Type: class

Base: ComponentBase

Summary:
Component used on rendering prefabs to configure how a curve mesh is generated/rendered. Exposes fields controlling tiling, length override, smoothing, geometry tiling modes, inversion, sub-flow behavior and a hanging/swaying flag. The component is placed in the "Rendering/" component menu and is associated with RenderPrefab. Methods for adding ECS conversion components are present but empty in this implementation.


Fields

  • public int m_TilingCount
    Number of times the curve texture/geometry should tile along the curve. Typical use: control repetition of texture/segments.

  • public float m_OverrideLength
    Optional override for the curve length. If > 0, this value may be used by the renderer/mesh generator instead of the calculated length.

  • public float m_SmoothingDistance
    Distance used to smooth the curve (blend or interpolation distance between segments).

  • public bool m_GeometryTiling
    When true, geometry tiling is enabled — the mesh geometry is duplicated/tiled rather than stretched.

  • public bool m_StraightTiling
    When true, tiling is performed in a straight manner (likely without following curve curvature for UVs/geometry).

  • public bool m_InvertCurve
    When true, inverts the curve direction/normal or flips some aspect of rendering (usage depends on mesh generation).

  • public bool m_SubFlow
    Flag likely used to indicate a sub-flow or secondary flow behavior in multi-flow curves.

  • public bool m_HangingSwaying
    (Previously serialized as m_Hanging) Enables hanging/swaying behavior for the curve object (e.g., for cables, banners). The FormerlySerializedAs attribute ensures old serialized data maps to this renamed field.

Properties

  • No public properties are defined on this type. All configuration is exposed via public fields.

Constructors

  • public CurveProperties()
    Default constructor (not explicitly defined in source). Instances are typically created/managed by Unity's serialization and prefab system.

Methods

  • public override void GetArchetypeComponents(HashSet<ComponentType> components)
    This override is intended to add component types that should be present on the ECS archetype when converting the prefab. In this implementation the method body is empty, so no archetype components are added by default.

  • public override void GetPrefabComponents(HashSet<ComponentType> components)
    This override is intended to add component types that should be part of the prefab conversion. It is empty here, so the prefab conversion does not add extra ECS components from this class by default.

Usage Example

// Example: configure CurveProperties on a prefab or created GameObject
var go = new GameObject("CurvePrefab");
var curveProps = go.AddComponent<Game.Prefabs.CurveProperties>();

curveProps.m_TilingCount = 4;
curveProps.m_OverrideLength = 10f;
curveProps.m_SmoothingDistance = 0.5f;
curveProps.m_GeometryTiling = true;
curveProps.m_StraightTiling = false;
curveProps.m_InvertCurve = false;
curveProps.m_SubFlow = false;
curveProps.m_HangingSwaying = true;

Additional notes: - The class is annotated with [ComponentMenu("Rendering/", typeof(RenderPrefab))], which places it in the Rendering menu and associates it with RenderPrefab in the editor. - The two Get*Components methods are the typical extension points for converting editor components to ECS components for Cities: Skylines 2 modding; to participate in conversion, add appropriate ComponentType entries to the provided HashSet inside those methods.