DungeonCharacter

Class in ChivalrousGames.DungeonMaster / Inherits from: MonoBehaviour

Description

Represents a character in the Dungeon that can collect keys and explore Rooms.

Fields

use2dPhysics bool Check this option to use 2d physics on the Character

Properties

CurrentRoom Room Gets or sets the room where the Character currently is.

Methods

GetAllCollectedKeysFULL version only
public List GetAllCollectedKeys();
Return
List<Spawnable> Gets all keys collected by the Character
Description

Gets all keys collected by the Character.

HasKeyFULL version only
public bool HasKey(string keyName);
Parameters
keyName string Name of the key to search for (which is the Spawnable asset name)
Return
bool True if the character has the key; otherwise, false
Description

Verifies if the Character has collected a specific key

GetKeyFULL version only
public Spawnable GetKey(string keyName);
Parameters
keyName string Name of the key to search for (which is the Spawnable asset name)
Return
Spawnable The Spawnable that is the key if found; otherwise, null.
Description

Searches for a specific key in the Character’s possession and returns the Spawnable if found. If not found, will return null.

HasKeyForLockFULL version only
public bool HasKeyForLock(ConnectorLock connectorLock);
Parameters
connectorLock ConnectorLock ConnectorLock for which to search the key.
Return
bool True if the character has the key; otherwise, false
Description

Verifies if the Character has collected the key for a specific lock

AddKeyFULL version only
public void AddKey(Spawnable key);
Parameters
key Spawnable The key to add to the Character’s key collection
Description

Adds a key to the Character’s key collection

RemoveKeyFULL version only
public void RemoveKey(Spawnable key);
Parameters
key Spawnable The key to remove from the Character’s key collection
Description

Removes a key from the Character’s key collection.

RemoveAllKeysFULL version only
public void RemoveAllKeys();
Description

Removes all keys from the Character’s key collection.