MapController
Class in ChivalrousGames.DungeonMaster / Inherits from: MonoBehaviour

Description

Allows the player to use the Dungeon map. Each dungeon needs its own MapController

Fields

inputButtonNamestringThe input button to press to toggle the full map.
characterDungeon CharacterThe character in the Dungeon.
dungeonDungeonThe dungeon.
centerMapOnFloorChangeboolIf true, then changing the map floor will center the map automatically; otherwise false.
centerModeMapCenterModeThe center map on floor change mode.

Properties

DisplayedLevelLevelReadOnly
The currently displayed level or null if no displayed level.
DisplayedFloorintReadOnly
The currently displayed floor or -1 if no displayed floor.
FullMapOpenedboolReadOnly
True if full map is opened; otherwise, false.

Methods

ResetMap
public void ResetMap();
Description
Resets the map to the appropriate Level and floor. Finds the Character in the map and centers on it.
ToggleFullMap
public virtual void ToggleFullMap();
Description
Toggles the full map (open/close). NOTE: Make sure the character cannot move around when the full map is opened.
ChangeFullMapLevelAndFloor
public void ChangeFullMapLevelAndFloor(Level level, int floor);
Parameters
levelLevelThe level to display
floorintThe floor to display
Description
Changes the full map display to specified level and floor.
ChangeFullMapUpOneFloor
public void ChangeFullMapUpOneFloor(bool WrapMode = true);
Parameters
wrapModeboolOptional
If set to true will wrap to show the bottom floor if currently on the top floor. Default value is true.
Description
Changes the full map up one floor.
ChangeFullMapDownOneFloor
public void ChangeFullMapDownOneFloor(bool wrapMode = true);
Parameters
wrapModeboolOptional
If set to true will wrap to show the top floor if currently on the bottom floor. Default value is true.
Description
Changes the full map down one floor.
GetDisplayedMapFloorCenter
public Vector3 GetDisplayedMapFloorCenter();
Return
Vector3The displayed map floor center. This is the center of level map not the center of the Level itself. If there is no displayed Level, will return Vector3.zero.
Description
Gets the displayed map floor center. This is done be calculating the average position of all Rooms map position of the Level.
CenterMapCamera
public void CenterMapCamera();
Description
Centers the map camera on the DisplayedLevel / DisplayedFloor. Map center is obtained with method GetDisplayedMapFloorCenter.
CenterMapCameraOnCharacter
public void CenterMapCameraOnCharacter();
Description
Centers the map camera on character.