Game.Routes.CurveElement
Assembly: Game
Namespace: Game.Routes
Type: struct
Base: IBufferElementData, IEmptySerializable
Summary:
Represents a single buffer element that stores a Bezier4x3 curve. This struct is intended for use as an ECS dynamic buffer element (DynamicBuffer
Fields
public Bezier4x3 m_Curve
Holds the Bezier4x3 curve data for this element. The Bezier4x3 type (from Colossal.Mathematics) encodes the 4 control points/coefficients for a 3D cubic Bezier curve used by routing/geometry code.
Properties
- None. This struct only exposes the public field m_Curve.
Constructors
public CurveElement()
No explicit constructors are defined in the source — the default value-type constructor is used. Initialize by assigning m_Curve when adding elements to a buffer.
Methods
- None.
Usage Example
// Example: create an entity, add a DynamicBuffer<CurveElement>, and append a curve element
var entityManager = Unity.Entities.World.DefaultGameObjectInjectionWorld.EntityManager;
var entity = entityManager.CreateEntity();
// Add a dynamic buffer of CurveElement to the entity
var buffer = entityManager.AddBuffer<Game.Routes.CurveElement>(entity);
// Obtain or construct a Bezier4x3 instance (implementation-specific)
Bezier4x3 myBezier = /* construct or retrieve a Bezier4x3 */;
// Add a curve element to the buffer
buffer.Add(new Game.Routes.CurveElement { m_Curve = myBezier });
{{ Additional notes:
- Use DynamicBuffer