C# Класс AutoTiles.AutoTilesBase

Наследование: UnityEngine.MonoBehaviour
Показать файл Открыть проект

Открытые свойства

Свойство Тип Описание
TreatBorderAsSolid bool
TreatCenterVariantsAsSpecial bool
TreatFloorVariantsAsSpecial bool
TreatSpecialAsSolid bool

Защищенные свойства (Protected)

Свойство Тип Описание
_mapDimensions Vector2
_numberOfMapLayers int

Открытые методы

Метод Описание
BuildIndexSpriteMap ( ) : void

this extensive method is used to fill a map with references to the correct sprite ids. This needs to be done for every possible bitmask combination value.

RebuildLayerInfo ( ) : void

This method is used by the editor to check and rebuild the layer dictionary. This is done in order to prevent a dead layer entry buildup (memory leaks) by editing the tilemap.

RebuildTiles ( ) : void

This method triggers the rebuild process. It should be triggered manually as soon as the tilemap changes

SetTile ( int bitmask, int x, int y, int l ) : void

This method is used for acually setting the file sprites depending on the bitmask value

Start ( ) : void

Защищенные методы

Метод Описание
CommitTile ( int x, int y, int l, int value ) : void

This method needs to be implemented by child classes to actually commit the tile to the target framework.

GetDimensions ( ) : Vector2

Child classes must implement this method to check for and store the map dimensions of the target framework. this method needs to return a List that contains a single Vector2 for each layer, where x is with and y is height.

GetTileValueFromFramwork ( int x, int y, int l ) : int

Child classes must implement this method to retrieve the value of a tile from the target framwork

RebuildFramework ( ) : void

Child classes must implement this method to trigger a update in the target framework after the data has been written.

UpdateFrameworkReferences ( ) : bool

This method needs to be implemented by child classes to update all necessary references to the target framework they might need for their framework specific operations. IMplementations should return true if all references have been found and false otherwise.

UpdateNumberOfLayers ( ) : void

This method need to be implemented by child classes to get the number of available tilemap layers from the target framework

Приватные методы

Метод Описание
CalculateBitmask ( int x, int y, int l ) : int

This method will calculate a bitmask value. To do this all surrounding cells are checked and the values will be accumulated.

GetTileState ( int x, int y, int l ) : int

This method checks the state of a single tile. Obeying the tk2dTileMap standard the following value will be returned 0: empty cell 1: solid cell cells that are out of bounds can count as empty or solid, depending on the TreatBorderAsSolid property.

SpriteIdIsSpecialTile ( int id ) : bool

This method checks if the conditions for a floor-tile or center variant tile to become a special tile are met.

Описание методов

BuildIndexSpriteMap() публичный Метод

this extensive method is used to fill a map with references to the correct sprite ids. This needs to be done for every possible bitmask combination value.
public BuildIndexSpriteMap ( ) : void
Результат void

CommitTile() защищенный абстрактный Метод

This method needs to be implemented by child classes to actually commit the tile to the target framework.
protected abstract CommitTile ( int x, int y, int l, int value ) : void
x int
y int
l int
value int
Результат void

GetDimensions() защищенный абстрактный Метод

Child classes must implement this method to check for and store the map dimensions of the target framework. this method needs to return a List that contains a single Vector2 for each layer, where x is with and y is height.
protected abstract GetDimensions ( ) : Vector2
Результат Vector2

GetTileValueFromFramwork() защищенный абстрактный Метод

Child classes must implement this method to retrieve the value of a tile from the target framwork
protected abstract GetTileValueFromFramwork ( int x, int y, int l ) : int
x int
y int
l int
Результат int

RebuildFramework() защищенный абстрактный Метод

Child classes must implement this method to trigger a update in the target framework after the data has been written.
protected abstract RebuildFramework ( ) : void
Результат void

RebuildLayerInfo() публичный Метод

This method is used by the editor to check and rebuild the layer dictionary. This is done in order to prevent a dead layer entry buildup (memory leaks) by editing the tilemap.
public RebuildLayerInfo ( ) : void
Результат void

RebuildTiles() публичный Метод

This method triggers the rebuild process. It should be triggered manually as soon as the tilemap changes
public RebuildTiles ( ) : void
Результат void

SetTile() публичный Метод

This method is used for acually setting the file sprites depending on the bitmask value
public SetTile ( int bitmask, int x, int y, int l ) : void
bitmask int
x int
y int
l int
Результат void

Start() публичный Метод

public Start ( ) : void
Результат void

UpdateFrameworkReferences() защищенный абстрактный Метод

This method needs to be implemented by child classes to update all necessary references to the target framework they might need for their framework specific operations. IMplementations should return true if all references have been found and false otherwise.
protected abstract UpdateFrameworkReferences ( ) : bool
Результат bool

UpdateNumberOfLayers() защищенный абстрактный Метод

This method need to be implemented by child classes to get the number of available tilemap layers from the target framework
protected abstract UpdateNumberOfLayers ( ) : void
Результат void

Описание свойств

TreatBorderAsSolid публичное свойство

If set to true, the script will treat all out of border coordinates as if they were solid cells insted of empty ones.
public bool TreatBorderAsSolid
Результат bool

TreatCenterVariantsAsSpecial публичное свойство

If this property is set, the three center variant tiles will be treated as special variants and will not be auto tiled.
public bool TreatCenterVariantsAsSpecial
Результат bool

TreatFloorVariantsAsSpecial публичное свойство

If this property is set, all six single block variant tiles will be treated as special variants and will not be auto tiled.
public bool TreatFloorVariantsAsSpecial
Результат bool

TreatSpecialAsSolid публичное свойство

If set to true, the script will treat all special tiles as if they were solid cells insted of empty ones.
public bool TreatSpecialAsSolid
Результат bool

_mapDimensions защищенное свойство

protected Vector2 _mapDimensions
Результат Vector2

_numberOfMapLayers защищенное свойство

protected int _numberOfMapLayers
Результат int