C# Class TileMap, UnderworldExporter

Inheritance: MonoBehaviour
Mostra file Open project: hankmorgan/UnderworldExporter Class Usage Examples

Public Properties

Property Type Description
Background Color[]
BorderColour Color[]
BridgeTileColour Color[]
GlobalCeilingHeight int
LavaTileColour Color[]
MapNotes List[]
OnGround bool
OnLava bool
OnWater bool
OpenTileColour Color[]
StairsTileColour Color[]
TileSize int
Tiles TileInfo[]
WaterTileColour Color[]
visitTileX int
visitTileY int

Public Methods

Method Description
DrawDiagNE ( int LevelNo, Texture2D OutputTile, int TileX, int TileY, int TileWidth, int TileHeight, Color InputColour ) : void

Draws the diag NE tile.

DrawDiagNW ( int LevelNo, Texture2D OutputTile, int TileX, int TileY, int TileWidth, int TileHeight, Color InputColour ) : void

Draws the diag NW tile

DrawDiagSE ( int LevelNo, Texture2D OutputTile, int TileX, int TileY, int TileWidth, int TileHeight, Color InputColour ) : void

Draws the diag SE tile.

DrawDiagSW ( int LevelNo, Texture2D OutputTile, int TileX, int TileY, int TileWidth, int TileHeight, Color InputColour ) : void

Draws a diagonal SW tile.

GetCeilingHeight ( int LevelNo, int tileX, int tileY ) : int

Gets the height of the ceiling. Will always be the same value in UW1/2 varies in SHOCK.

GetFloorHeight ( int LevelNo, int tileX, int tileY ) : int

Gets the height of the floor for the specified tile.

GetTileType ( int tileX, int tileY ) : int

Gets the type of the tile.

GetTileType ( int LevelNo, int tileX, int tileY ) : int

Gets the type of the tile.

LoadTileMapInfo ( string fileName ) : bool

Loads the tile map info from a config file called GAMENAME+ "_tileprops.txt"

PickColour ( Color Selection ) : Color

Picks a random colour from the array of colours

PositionDetect ( ) : void

Detects where the player currently is an updates their swimming state and auto map as needed.

SetCeilingHeight ( int LevelNo, int tileX, int tileY, int newHeight ) : void

Sets the height of the ceiling.

SetFloorHeight ( int LevelNo, int tileX, int tileY, int newHeight ) : void

Sets the height of the floor.

SetTileVisited ( int LevelNo, int tileX, int tileY ) : void

Sets the tile and it's neighbours as visited. visited.

Start ( ) : void
TileMapImage ( ) : Texture2D

Generates a tile map image for the automap for the current level.

TileMapImage ( int LevelNo ) : Texture2D

Generates a tile map image for the automap for the specified level.

ValidTile ( Vector3 location ) : bool

Checks to see if the tile at a specified location is within the valid game world. (eg is rendered and is not a solid). Assumes the map is positioned at 0,0,0

current ( ) : TileInfo

Returns the current levels tile map info.

getTileVector ( int tileX, int tileY ) : Vector3

Gets the vector3 at the center of the tile specified.

isTileOpen ( int TileType ) : bool

Tells if the tile is one of the square open types

Private Methods

Method Description
DrawDoor ( Texture2D OutputTile, int LevelNo, int TileX, int TileY, int TileWidth, int TileHeight, Color InputColour ) : void

Draws a door at the tile specified. Checks the neighbouring tiles to find out which one is open

DrawLine ( Texture2D OutputTile, int TileX, int TileY, int TileWidth, int TileHeight, Color InputColour, int Direction ) : void

Draws a line at the specified border direction.

DrawOpenTile ( int LevelNo, Texture2D OutputTile, int TileX, int TileY, int TileWidth, int TileHeight, Color InputColour ) : void

Draws the open tile. Checks the neighbouring tiles to see if it needs to draw a border.

DrawSolidTile ( Texture2D OutputTile, int TileX, int TileY, int TileWidth, int TileHeight, Color InputColour ) : void

Draws a solid tile with no border.

GetIsBridge ( int LevelNo, int tileX, int tileY ) : bool

Gets if the tile is a bridge.

GetIsDoor ( int LevelNo, int tileX, int tileY ) : bool

Gets if the tile contains a door.

GetIsLava ( int LevelNo, int tileX, int tileY ) : bool

Is the tile Lava

GetIsWater ( int LevelNo, int tileX, int tileY ) : bool

Is the tile water.

GetTileRender ( int LevelNo, int tileX, int tileY ) : int

Gets the tile render state. Only affects the automap.

GetTileVisited ( int LevelNo, int tileX, int tileY ) : bool

Has the tile been already visited.

MarkTile ( int LevelNo, int tileX, int tileY ) : void

Marks the tile as visited and checks if it is in range.

SetIsBridge ( int LevelNo, int tileX, int tileY, int iIsBridge ) : void

Marks if the tile has a bridge.

SetIsDoor ( int LevelNo, int tileX, int tileY, int iIsDoor ) : void

Sets if the tile is a door

SetIsLava ( int LevelNo, int tileX, int tileY, int iIsLava ) : void

Sets if the tile is lava.

SetIsWater ( int LevelNo, int tileX, int tileY, int iIsWater ) : void

Sets if the tile is water.

SetTileProp ( int LevelNo, int tileX, int tileY, int itileType, int iRender, int FloorHeight, int CeilingHeight, int iIsWater, int iIsDoor, int iIsLava, int iIsBridge ) : void

Sets the tile properties that are read in from tileprops.txt

SetTileRender ( int LevelNo, int tileX, int tileY, int iRender ) : void

Sets the tile render state. Only affects the automap.

SetTileType ( int LevelNo, int tileX, int tileY, int itileType ) : void

Sets the type of the tile.

fillTile ( int LevelNo, Texture2D OutputTile, int TileX, int TileY, int TileWidth, int TileHeight, Color GroundColour, Color WaterColour, Color LavaColour, Color BridgeColour ) : void

Fills in a single tile.

Method Details

DrawDiagNE() public method

Draws the diag NE tile.
public DrawDiagNE ( int LevelNo, Texture2D OutputTile, int TileX, int TileY, int TileWidth, int TileHeight, Color InputColour ) : void
LevelNo int Level no.
OutputTile UnityEngine.Texture2D Output tile.
TileX int Tile x.
TileY int Tile y.
TileWidth int Tile width.
TileHeight int Tile height.
InputColour Color Input colour.
return void

DrawDiagNW() public method

Draws the diag NW tile
public DrawDiagNW ( int LevelNo, Texture2D OutputTile, int TileX, int TileY, int TileWidth, int TileHeight, Color InputColour ) : void
LevelNo int Level no.
OutputTile UnityEngine.Texture2D Output tile.
TileX int Tile x.
TileY int Tile y.
TileWidth int Tile width.
TileHeight int Tile height.
InputColour Color Input colour.
return void

DrawDiagSE() public method

Draws the diag SE tile.
public DrawDiagSE ( int LevelNo, Texture2D OutputTile, int TileX, int TileY, int TileWidth, int TileHeight, Color InputColour ) : void
LevelNo int Level no.
OutputTile UnityEngine.Texture2D Output tile.
TileX int Tile x.
TileY int Tile y.
TileWidth int Tile width.
TileHeight int Tile height.
InputColour Color Input colour.
return void

DrawDiagSW() public method

Draws a diagonal SW tile.
public DrawDiagSW ( int LevelNo, Texture2D OutputTile, int TileX, int TileY, int TileWidth, int TileHeight, Color InputColour ) : void
LevelNo int Level no.
OutputTile UnityEngine.Texture2D Output tile.
TileX int Tile x.
TileY int Tile y.
TileWidth int Tile width.
TileHeight int Tile height.
InputColour Color Input colour.
return void

GetCeilingHeight() public method

Gets the height of the ceiling. Will always be the same value in UW1/2 varies in SHOCK.
public GetCeilingHeight ( int LevelNo, int tileX, int tileY ) : int
LevelNo int Level no.
tileX int Tile x.
tileY int Tile y.
return int

GetFloorHeight() public method

Gets the height of the floor for the specified tile.
public GetFloorHeight ( int LevelNo, int tileX, int tileY ) : int
LevelNo int Level no.
tileX int Tile x.
tileY int Tile y.
return int

GetTileType() public method

Gets the type of the tile.
public GetTileType ( int tileX, int tileY ) : int
tileX int Tile x.
tileY int Tile y.
return int

GetTileType() public method

Gets the type of the tile.
public GetTileType ( int LevelNo, int tileX, int tileY ) : int
LevelNo int Level no.
tileX int Tile x.
tileY int Tile y.
return int

LoadTileMapInfo() public method

Loads the tile map info from a config file called GAMENAME+ "_tileprops.txt"
public LoadTileMapInfo ( string fileName ) : bool
fileName string File name.
return bool

PickColour() public method

Picks a random colour from the array of colours
public PickColour ( Color Selection ) : Color
Selection Color Selection.
return Color

PositionDetect() public method

Detects where the player currently is an updates their swimming state and auto map as needed.
public PositionDetect ( ) : void
return void

SetCeilingHeight() public method

Sets the height of the ceiling.
public SetCeilingHeight ( int LevelNo, int tileX, int tileY, int newHeight ) : void
LevelNo int Level no.
tileX int Tile x.
tileY int Tile y.
newHeight int New height.
return void

SetFloorHeight() public method

Sets the height of the floor.
public SetFloorHeight ( int LevelNo, int tileX, int tileY, int newHeight ) : void
LevelNo int Level no.
tileX int Tile x.
tileY int Tile y.
newHeight int New height.
return void

SetTileVisited() public method

Sets the tile and it's neighbours as visited. visited.
public SetTileVisited ( int LevelNo, int tileX, int tileY ) : void
LevelNo int Level no.
tileX int Tile x.
tileY int Tile y.
return void

Start() public method

public Start ( ) : void
return void

TileMapImage() public method

Generates a tile map image for the automap for the current level.
public TileMapImage ( ) : Texture2D
return Texture2D

TileMapImage() public method

Generates a tile map image for the automap for the specified level.
public TileMapImage ( int LevelNo ) : Texture2D
LevelNo int Level no.
return Texture2D

ValidTile() public method

Checks to see if the tile at a specified location is within the valid game world. (eg is rendered and is not a solid). Assumes the map is positioned at 0,0,0
public ValidTile ( Vector3 location ) : bool
location Vector3 Location.
return bool

current() public method

Returns the current levels tile map info.
public current ( ) : TileInfo
return TileInfo

getTileVector() public method

Gets the vector3 at the center of the tile specified.
public getTileVector ( int tileX, int tileY ) : Vector3
tileX int Tile x.
tileY int Tile y.
return Vector3

isTileOpen() public method

Tells if the tile is one of the square open types
public isTileOpen ( int TileType ) : bool
TileType int Tile type.
return bool

Property Details

Background public_oe property

The background colour of the map.
public Color[] Background
return Color[]

BorderColour public_oe property

Wall border colour.
public Color[] BorderColour
return Color[]

BridgeTileColour public_oe property

The bridge tile colour.
public Color[] BridgeTileColour
return Color[]

GlobalCeilingHeight public_oe property

The height of the max ceiling value for this level. Only used in SHOCK moving platform.
public int GlobalCeilingHeight
return int

LavaTileColour public_oe property

The lava tile colour.
public Color[] LavaTileColour
return Color[]

MapNotes public_oe property

Player written Map notes stored in a list.
public List[] MapNotes
return List[]

OnGround public_oe static_oe property

Is the player currently standing on solid ground
public static bool OnGround
return bool

OnLava public_oe static_oe property

Is the player currently standing on lava.
public static bool OnLava
return bool

OnWater public_oe static_oe property

Is the player currently standing(swimming) on water
public static bool OnWater
return bool

OpenTileColour public_oe property

The open tile colour.
public Color[] OpenTileColour
return Color[]

StairsTileColour public_oe property

The stairs tile colour.
public Color[] StairsTileColour
return Color[]

TileSize public_oe property

The size of the tile in pixels in the map display
public int TileSize
return int

Tiles public_oe property

Tile info storage class
public TileInfo[] Tiles
return TileInfo[]

WaterTileColour public_oe property

The water tile colour.
public Color[] WaterTileColour
return Color[]

visitTileX public_oe property

The current tile X that the player is in
public int visitTileX
return int

visitTileY public_oe property

The current tile Y that the player is in.
public int visitTileY
return int