Table of Contents

Struct SerializableGridTopologyMetrics

Unity-serializable authoring data for GridTopologyMetrics.

[Serializable]
public struct SerializableGridTopologyMetrics
Inherited Members

Properties

DefaultHex

Gets unit pointy-top hex-prism metrics.

public static SerializableGridTopologyMetrics DefaultHex { get; }

Property Value

SerializableGridTopologyMetrics

DefaultRectangular

Gets unit rectangular-prism metrics.

public static SerializableGridTopologyMetrics DefaultRectangular { get; }

Property Value

SerializableGridTopologyMetrics

HexLayerHeight

Gets the hexagonal layer height.

public readonly Fixed64 HexLayerHeight { get; }

Property Value

Fixed64

HexOrientation

Gets the hexagonal cell orientation.

public readonly HexOrientation HexOrientation { get; }

Property Value

HexOrientation

HexRadius

Gets the hexagonal cell radius.

public readonly Fixed64 HexRadius { get; }

Property Value

Fixed64

RectangularCellLength

Gets the rectangular cell length.

public readonly Fixed64 RectangularCellLength { get; }

Property Value

Fixed64

RectangularCellWidth

Gets the rectangular cell width.

public readonly Fixed64 RectangularCellWidth { get; }

Property Value

Fixed64

RectangularLayerHeight

Gets the rectangular layer height.

public readonly Fixed64 RectangularLayerHeight { get; }

Property Value

Fixed64

Methods

FromGridTopologyMetrics(GridTopologyKind, GridTopologyMetrics)

Creates serializable metrics from runtime topology metrics.

public static SerializableGridTopologyMetrics FromGridTopologyMetrics(GridTopologyKind topologyKind, GridTopologyMetrics metrics)

Parameters

topologyKind GridTopologyKind

The topology that determines which metrics are copied.

metrics GridTopologyMetrics

The runtime metrics.

Returns

SerializableGridTopologyMetrics

The serializable metrics.

Hex(Fixed64, Fixed64, HexOrientation)

Creates hex-prism topology metrics.

public static SerializableGridTopologyMetrics Hex(Fixed64 radius, Fixed64 layerHeight, HexOrientation orientation)

Parameters

radius Fixed64

The hexagonal cell radius.

layerHeight Fixed64

The layer height.

orientation HexOrientation

The hexagonal cell orientation.

Returns

SerializableGridTopologyMetrics

The serializable metrics.

Rectangular(Fixed64, Fixed64, Fixed64)

Creates rectangular-prism topology metrics.

public static SerializableGridTopologyMetrics Rectangular(Fixed64 cellWidth, Fixed64 layerHeight, Fixed64 cellLength)

Parameters

cellWidth Fixed64

The cell width.

layerHeight Fixed64

The layer height.

cellLength Fixed64

The cell length.

Returns

SerializableGridTopologyMetrics

The serializable metrics.

TryToGridTopologyMetrics(GridTopologyKind, out GridTopologyMetrics, out string)

Validates and converts these values to runtime topology metrics.

public readonly bool TryToGridTopologyMetrics(GridTopologyKind topologyKind, out GridTopologyMetrics metrics, out string failureReason)

Parameters

topologyKind GridTopologyKind

The topology to convert.

metrics GridTopologyMetrics

Receives the runtime metrics.

failureReason string

Receives the validation failure reason.

Returns

bool

true when conversion succeeds.