Class Chamber
A wrapper for MapGeneration.Distributors.LockerChamber.
public class Chamber : IWrapper<LockerChamber>, IWorldSpace, IPosition, IRotation
- Inheritance
-
Chamber
- Implements
-
IWrapper<LockerChamber>
- Inherited Members
- Extension Methods
Constructors
Chamber(LockerChamber, Locker)
Initializes a new instance of the Chamber class.
public Chamber(LockerChamber chamber, Locker locker)
Parameters
chamber
LockerChamberMapGeneration.Distributors.LockerChamber instance.
locker
LockerLocker where this chamber is located.
Properties
AcceptableTypes
Gets or sets all the acceptable items which can be spawned in this chamber.
public IEnumerable<ItemType> AcceptableTypes { get; set; }
Property Value
- IEnumerable<ItemType>
Base
Gets the base MapGeneration.Distributors.LockerChamber that this class is wrapping.
public LockerChamber Base { get; }
Property Value
- LockerChamber
CanInteract
Gets a value indicating whether the chamber is interactable.
public bool CanInteract { get; }
Property Value
Cooldown
Gets or sets the amount of time before a player can interact with the chamber again.
public float Cooldown { get; set; }
Property Value
CurrentCooldown
Gets the Stopwatch of current cooldown.
public Stopwatch CurrentCooldown { get; }
Property Value
Remarks
Used in CanInteract check.
GameObject
Gets the Chamber UnityEngine.GameObject.
public GameObject GameObject { get; }
Property Value
- GameObject
Id
Gets the id of this chamber in Locker.
public byte Id { get; }
Property Value
InitiallySpawn
Gets or sets a value indicating whether items should be spawned as soon as they one chamber is opened.
public bool InitiallySpawn { get; set; }
Property Value
IsOpen
Gets or sets a value indicating whether the chamber is currently open.
public bool IsOpen { get; set; }
Property Value
List
Gets a IEnumerable<T> of Chamber which contains all the Chamber instances.
public static IReadOnlyCollection<Chamber> List { get; }
Property Value
Locker
Gets the Locker where this chamber is located at.
public Locker Locker { get; }
Property Value
Position
Gets the position of this object.
public Vector3 Position { get; }
Property Value
- Vector3
RequiredPermissions
Gets or sets required permissions to open this chamber.
public KeycardPermissions RequiredPermissions { get; set; }
Property Value
Rotation
Gets the rotation of this object.
public Quaternion Rotation { get; }
Property Value
- Quaternion
Spawnpoint
Gets or sets a spawn point for the items in the chamber.
public Transform Spawnpoint { get; set; }
Property Value
- Transform
Remarks
Used if UseMultipleSpawnpoints is set to false.
Spawnpoints
Gets or sets all spawn points.
public IEnumerable<Transform> Spawnpoints { get; set; }
Property Value
- IEnumerable<Transform>
Remarks
Used if UseMultipleSpawnpoints is set to true.
ToBeSpawned
Gets or sets all pickups that should be spawned when the door is initially opened.
public IEnumerable<Pickup> ToBeSpawned { get; set; }
Property Value
Transform
Gets the Chamber UnityEngine.Transform.
public Transform Transform { get; }
Property Value
- Transform
UseMultipleSpawnpoints
Gets or sets a value indicating whether multiple spawn points should be used.
public bool UseMultipleSpawnpoints { get; set; }
Property Value
Remarks
If true, Spawnpoints will be used over Spawnpoint.
Methods
AddItemToSpawn(ItemType, int, bool)
Adds an item of the specified type to the chamber's spawn list.
If the chamber is open and spawnIfIsOpen
is set to true,
the item is spawned immediately at a random spawn point within the chamber.
public void AddItemToSpawn(ItemType itemType, int quantity = 1, bool spawnIfIsOpen = false)
Parameters
itemType
ItemTypeThe type of item to add to the spawn list.
quantity
intThe number of items to add. Defaults to 1.
spawnIfIsOpen
boolIf true and the chamber is open, the item is immediately spawned at a random spawn point. Otherwise, the item is added to the spawn list and will spawn when the chamber is opened.
GetRandomSpawnPoint()
Gets a random spawn point within the chamber. If multiple spawn points are available and UseMultipleSpawnpoints is true, a random spawn point is selected from the available points. Otherwise, the default spawn point is used.
public Vector3 GetRandomSpawnPoint()
Returns
- Vector3
A UnityEngine.Vector3 representing the position of the selected spawn point.
SpawnItem(ItemType, int)
Spawns a specified item from AcceptableTypes.
public void SpawnItem(ItemType type, int amount)
Parameters
type
ItemTypeItemType from AcceptableTypes.
amount
intAmount of items that should be spawned.