C# Class TileMap, UnderworldExporter

Inheritance: MonoBehaviour
Afficher le fichier Open project: hankmorgan/UnderworldExporter Class Usage Examples

Méthodes publiques

Свойство 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

Méthodes publiques

Méthode 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

Méthode 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 méthode

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.
Résultat void

DrawDiagNW() public méthode

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.
Résultat void

DrawDiagSE() public méthode

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.
Résultat void

DrawDiagSW() public méthode

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.
Résultat void

GetCeilingHeight() public méthode

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.
Résultat int

GetFloorHeight() public méthode

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.
Résultat int

GetTileType() public méthode

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

GetTileType() public méthode

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.
Résultat int

LoadTileMapInfo() public méthode

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

PickColour() public méthode

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

PositionDetect() public méthode

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

SetCeilingHeight() public méthode

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.
Résultat void

SetFloorHeight() public méthode

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.
Résultat void

SetTileVisited() public méthode

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.
Résultat void

Start() public méthode

public Start ( ) : void
Résultat void

TileMapImage() public méthode

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

TileMapImage() public méthode

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

ValidTile() public méthode

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.
Résultat bool

current() public méthode

Returns the current levels tile map info.
public current ( ) : TileInfo
Résultat TileInfo

getTileVector() public méthode

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.
Résultat Vector3

isTileOpen() public méthode

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

Property Details

Background public_oe property

The background colour of the map.
public Color[] Background
Résultat Color[]

BorderColour public_oe property

Wall border colour.
public Color[] BorderColour
Résultat Color[]

BridgeTileColour public_oe property

The bridge tile colour.
public Color[] BridgeTileColour
Résultat Color[]

GlobalCeilingHeight public_oe property

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

LavaTileColour public_oe property

The lava tile colour.
public Color[] LavaTileColour
Résultat Color[]

MapNotes public_oe property

Player written Map notes stored in a list.
public List[] MapNotes
Résultat List[]

OnGround public_oe static_oe property

Is the player currently standing on solid ground
public static bool OnGround
Résultat bool

OnLava public_oe static_oe property

Is the player currently standing on lava.
public static bool OnLava
Résultat bool

OnWater public_oe static_oe property

Is the player currently standing(swimming) on water
public static bool OnWater
Résultat bool

OpenTileColour public_oe property

The open tile colour.
public Color[] OpenTileColour
Résultat Color[]

StairsTileColour public_oe property

The stairs tile colour.
public Color[] StairsTileColour
Résultat Color[]

TileSize public_oe property

The size of the tile in pixels in the map display
public int TileSize
Résultat int

Tiles public_oe property

Tile info storage class
public TileInfo[] Tiles
Résultat TileInfo[]

WaterTileColour public_oe property

The water tile colour.
public Color[] WaterTileColour
Résultat Color[]

visitTileX public_oe property

The current tile X that the player is in
public int visitTileX
Résultat int

visitTileY public_oe property

The current tile Y that the player is in.
public int visitTileY
Résultat int