AudioAsset
Ease
FastString
FontAsset
NineSlice
PackedSprite
PackedSpriteID
RB
   HardwareSettings
   IRetroBlitGame
RBAsset
Rect2i
ShaderAsset
SoundReference
SpriteGrid
SpriteSheetAsset
TMXMapAsset
   TMXLayer
   TMXLayerLoadState
   TMXObject
   TMXObjectGroup
   TMXProperties
Vector2i

RB.MapDataGet< T >

Method  -  Static

public static T MapDataGet< T >(int layer, Vector2i tilePos)

Parameters

layer int Tilemap layer
tilePos Vector2i Tile position

Returns

T

Data

Description

Get user tile data at the given layer and tilePos, which was previously set with RB.MapDataSet<T>.

Example

const int LAYER_TERRAIN = 0;

void Initialize() {
    int width = 16;
    int height = 16;

    for (int x = 0; x < 16; x++) {
        for (int x = 0; x < 16; x++) {
            blocking = Random.Range(02) == 0 ? false : true;

            RB.MapDataSet<bool>(LAYER_TERRAIN, new Vector2i(x, y), blocking);
        }
    }
}

void Update() {
    bool blocking = RB.MapDataGet<bool>(LAYER_TERRAIN, playerTilePos);

    if (blocking) {
        KillPlayer();
    }
}

See Also

RB.MapDataGet<T>
RB.MapLayerSpriteSheetSet

See Docs

Features - Tilemaps
Features - Setting or Getting Tile Info