Table of Contents

Class Room

Namespace
Exiled.API.Features
Assembly
Exiled.API.dll

The in-game room.

public class Room : MonoBehaviour, IWorldSpace, IPosition, IRotation
Inheritance
Object
Component
Behaviour
MonoBehaviour
Room
Implements
Inherited Members
MonoBehaviour.IsInvoking()
MonoBehaviour.CancelInvoke()
MonoBehaviour.StopCoroutine(Coroutine)
MonoBehaviour.StopAllCoroutines()
MonoBehaviour.useGUILayout
Behaviour.enabled
Behaviour.isActiveAndEnabled
Component.GetComponent<T>()
Component.TryGetComponent<T>(out T)
Component.GetComponentInChildren<T>()
Component.GetComponentsInChildren<T>()
Component.GetComponentInParent<T>()
Component.GetComponentsInParent<T>()
Component.GetComponents<T>()
Component.transform
Component.gameObject
Component.tag
Object.GetInstanceID()
Object.GetHashCode()
Object.Instantiate(Object, Vector3, Quaternion)
Object.Instantiate(Object, Vector3, Quaternion, Transform)
Object.Instantiate(Object)
Object.Instantiate(Object, Transform)
Object.Instantiate<T>(T)
Object.Instantiate<T>(T, Vector3, Quaternion)
Object.Instantiate<T>(T, Vector3, Quaternion, Transform)
Object.Instantiate<T>(T, Transform)
Object.Destroy(Object)
Object.DestroyImmediate(Object)
Object.DontDestroyOnLoad(Object)
Object.DestroyObject(Object)
Object.FindObjectsOfType<T>()
Object.FindObjectOfType<T>()
Object.name
Object.hideFlags
Extension Methods

Properties

AreLightsOff

Gets or sets a value indicating whether the lights in this room are currently off.

public bool AreLightsOff { get; set; }

Property Value

bool

Cameras

public IReadOnlyCollection<Camera> Cameras { get; }

Property Value

IReadOnlyCollection<Camera>

Color

Gets or sets the color of the room's lights by changing the warhead color.

public Color Color { get; set; }

Property Value

Color

Remarks

Will return UnityEngine.Color.clear when RoomLightController is null.

Doors

Gets a IReadOnlyCollection<T> of Door in the Room.

public IReadOnlyCollection<Door> Doors { get; }

Property Value

IReadOnlyCollection<Door>

GameObject

Gets the Room UnityEngine.GameObject.

public GameObject GameObject { get; }

Property Value

GameObject

Identifier

Gets a reference to the room's MapGeneration.RoomIdentifier.

public RoomIdentifier Identifier { get; }

Property Value

RoomIdentifier

List

Gets a IEnumerable<T> of Room which contains all the Room instances.

public static IReadOnlyCollection<Room> List { get; }

Property Value

IReadOnlyCollection<Room>

Name

Gets the Room name.

public string Name { get; }

Property Value

string

NearestRooms

Gets a IReadOnlyList<T> of Room around the Room.

public IReadOnlyList<Room> NearestRooms { get; }

Property Value

IReadOnlyList<Room>

Pickups

Gets a IEnumerable<T> of Pickup in the Room.

public IEnumerable<Pickup> Pickups { get; }

Property Value

IEnumerable<Pickup>

Players

Gets a IEnumerable<T> of Player in the Room.

public IEnumerable<Player> Players { get; }

Property Value

IEnumerable<Player>

Position

Gets the Room position.

public Vector3 Position { get; }

Property Value

Vector3

RoomLightController

Gets the room's FlickerableLightController.

public RoomLightController RoomLightController { get; }

Property Value

RoomLightController

RoomLightControllerNetIdentity

Gets the FlickerableLightController's NetworkIdentity.

public NetworkIdentity RoomLightControllerNetIdentity { get; }

Property Value

NetworkIdentity

RoomLightControllers

public IReadOnlyCollection<RoomLightController> RoomLightControllers { get; }

Property Value

IReadOnlyCollection<RoomLightController>

Remarks

Using that will make sense only for rooms with more than one light controller, in other cases better to use RoomLightController.

RoomName

Gets the MapGeneration.RoomName enum representing this room.

public RoomName RoomName { get; }

Property Value

RoomName

Remarks

This property is the internal MapGeneration.RoomName of the room. For the actual string of the Room's name, see Name.

See Also

RoomShape

Gets the room's MapGeneration.RoomShape.

public RoomShape RoomShape { get; }

Property Value

RoomShape

Rotation

Gets the Room rotation.

public Quaternion Rotation { get; }

Property Value

Quaternion

Speakers

Gets a IReadOnlyCollection<T> of PlayerRoles.PlayableScps.Scp079.Scp079Speaker in the Room.

public IReadOnlyCollection<Scp079Speaker> Speakers { get; }

Property Value

IReadOnlyCollection<Scp079Speaker>

TeslaGate

Gets a reference to the TeslaGate in the room, or null if this room does not contain one.

public TeslaGate TeslaGate { get; }

Property Value

TeslaGate

Transform

Gets the Room UnityEngine.Transform.

public Transform Transform { get; }

Property Value

Transform

Type

Gets the RoomType.

public RoomType Type { get; }

Property Value

RoomType

Windows

public IReadOnlyCollection<Window> Windows { get; }

Property Value

IReadOnlyCollection<Window>

Zone

Gets the ZoneType in which the room is located.

public ZoneType Zone { get; }

Property Value

ZoneType

Methods

Blackout(float, DoorLockType)

Locks all the doors and turns off all lights in the room.

public void Blackout(float duration, DoorLockType lockType = DoorLockType.Regular079)

Parameters

duration float

Duration in seconds, or -1 for permanent blackout.

lockType DoorLockType

DoorLockType of the blackout.

See Also

FindParentRoom(GameObject)

Tries to find the room that a GameObject is inside, first using the Transform's parents, then using a Raycast if no room was found.

public static Room FindParentRoom(GameObject objectInRoom)

Parameters

objectInRoom GameObject

The GameObject inside the room.

Returns

Room

The Room that the GameObject is located inside. Can be null.

See Also

Get(RoomType)

Gets a Room given the specified RoomType.

public static Room Get(RoomType roomType)

Parameters

roomType RoomType

The RoomType to search for.

Returns

Room

The Room with the given RoomType or null if not found.

Get(ZoneType)

Gets a IEnumerable<T> of Room given the specified ZoneType.

public static IEnumerable<Room> Get(ZoneType zoneType)

Parameters

zoneType ZoneType

The ZoneType to search for.

Returns

IEnumerable<Room>

The Room with the given ZoneType or null if not found.

Get(RoomIdentifier)

Gets a Room from a given Identifier.

public static Room Get(RoomIdentifier roomIdentifier)

Parameters

roomIdentifier RoomIdentifier

The Identifier to search with.

Returns

Room

The Room of the given identified, if any. Can be null.

Get(RelativePosition)

Gets a Room given the specified RelativePositioning.RelativePosition.

public static Room Get(RelativePosition position)

Parameters

position RelativePosition

The RelativePositioning.RelativePosition to search for.

Returns

Room

The Room with the given RelativePositioning.RelativePosition or null if not found.

Get(RoomLightController)

Gets a Room from a given MapGeneration.RoomIdentifier.

public static Room Get(RoomLightController flickerableLightController)

Parameters

flickerableLightController RoomLightController

The RoomLightController to search with.

Returns

Room

The Room of the given identified, if any. Can be null.

Get(Func<Room, bool>)

Gets a IEnumerable<T> of Room filtered based on a predicate.

public static IEnumerable<Room> Get(Func<Room, bool> predicate)

Parameters

predicate Func<Room, bool>

The condition to satify.

Returns

IEnumerable<Room>

A IEnumerable<T> of Room which contains elements that satify the condition.

Get(Vector3)

Gets a Room given the specified UnityEngine.Vector3.

public static Room Get(Vector3 position)

Parameters

position Vector3

The UnityEngine.Vector3 to search for.

Returns

Room

The Room with the given UnityEngine.Vector3 or null if not found.

LocalPosition(Vector3)

Returns the local space position, based on a world space position.

public Vector3 LocalPosition(Vector3 position)

Parameters

position Vector3

World position.

Returns

Vector3

Local position, based on the room.

LockDown(float, DoorLockType)

Locks all the doors in the room.

public void LockDown(float duration, DoorLockType lockType = DoorLockType.Regular079)

Parameters

duration float

Duration in seconds, or -1 for permanent lockdown.

lockType DoorLockType

DoorLockType of the lockdown.

See Also

Random(ZoneType)

Gets a random Room.

public static Room Random(ZoneType zoneType = ZoneType.Unspecified)

Parameters

zoneType ZoneType

Filters by ZoneType.

Returns

Room

Room object.

ResetColor()

Resets the room color to default.

public void ResetColor()

ToString()

Returns the Room in a human-readable format.

public override string ToString()

Returns

string

A string containing Room-related data.

TurnOffLights(float)

Flickers the room's lights off for a duration.

public void TurnOffLights(float duration = -1)

Parameters

duration float

Duration in seconds, or -1 for an indefinite duration.

UnlockAll()

Unlocks all the doors in the room.

public void UnlockAll()
See Also

WorldPosition(Vector3)

Returns the World position, based on a local space position.

public Vector3 WorldPosition(Vector3 offset)

Parameters

offset Vector3

Local position.

Returns

Vector3

World position, based on the room.