Skip to main content

Map

A class in Root.Township, Alta.Map.

A hashed map asset: the map pieces players can uncover and the world area it covers.

Constructors​

MemberWhat it is
Map()Use ScriptableObject.CreateInstance instead of new; Unity loads the saved ones from assets.

Fields​

5 private and internal fields
MemberWhat it is
private uint firstNonReservedIndexBacking field for FirstNonReservedIndex. Landmark indexes below it are reserved; new ones start here. 1000 by default.
private MapPiece[] globalMapPiecesBacking field for GlobalMapPieces.
private MapPiece[] piecesBacking field for Pieces, the map pieces players can discover.
private Vector2 worldPositionBottomLeftBacking field for WorldPositionBottomLeft: the world x/z of the map's bottom-left corner.
private Vector2 worldPositionTopRightBacking field for WorldPositionTopRight: the world x/z of the map's top-right corner.

Properties​

MemberWhat it is
uint FirstNonReservedIndex { get; }First landmark index not reserved for fixed landmarks (default 1000).
MapPiece[] GlobalMapPieces { get; }Map pieces shown to everyone.
MapPiece[] Pieces { get; }The map pieces that can be uncovered.
Vector2 WorldPositionBottomLeft { get; }World XZ of the map's bottom-left corner.
Vector2 WorldPositionTopRight { get; }World XZ of the map's top-right corner.

Events​

MemberWhat it is
event Action<int, MapPiece> PieceDiscoveredRaised with the index and piece when a map piece is uncovered.

Methods​

MemberWhat it is
void OnPieceDiscovered(int pieceIndex)Raises PieceDiscovered for a piece index.

Used in​

Members of other types that take, return or hold a Map: