C# Class AutoTiles.AutoTilesBase

Inheritance: UnityEngine.MonoBehaviour
Mostra file Open project: visionvortex/2DToolkitAutoTiles-inofficial

Public Properties

Property Type Description
TreatBorderAsSolid bool
TreatCenterVariantsAsSpecial bool
TreatFloorVariantsAsSpecial bool
TreatSpecialAsSolid bool

Protected Properties

Property Type Description
_mapDimensions Vector2
_numberOfMapLayers int

Public Methods

Method Description
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

Protected Methods

Method Description
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

Private Methods

Method Description
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.

Method Details

BuildIndexSpriteMap() public method

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
return void

CommitTile() protected abstract method

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
return void

GetDimensions() protected abstract method

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
return Vector2

GetTileValueFromFramwork() protected abstract method

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
return int

RebuildFramework() protected abstract method

Child classes must implement this method to trigger a update in the target framework after the data has been written.
protected abstract RebuildFramework ( ) : void
return void

RebuildLayerInfo() public method

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
return void

RebuildTiles() public method

This method triggers the rebuild process. It should be triggered manually as soon as the tilemap changes
public RebuildTiles ( ) : void
return void

SetTile() public method

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
return void

Start() public method

public Start ( ) : void
return void

UpdateFrameworkReferences() protected abstract method

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
return bool

UpdateNumberOfLayers() protected abstract method

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
return void

Property Details

TreatBorderAsSolid public_oe property

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
return bool

TreatCenterVariantsAsSpecial public_oe property

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
return bool

TreatFloorVariantsAsSpecial public_oe property

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
return bool

TreatSpecialAsSolid public_oe property

If set to true, the script will treat all special tiles as if they were solid cells insted of empty ones.
public bool TreatSpecialAsSolid
return bool

_mapDimensions protected_oe property

protected Vector2 _mapDimensions
return Vector2

_numberOfMapLayers protected_oe property

protected int _numberOfMapLayers
return int