Class Room
The in-game room.
public class Room : MonoBehaviour, IWorldSpace, IPosition, IRotation
- Inheritance
-
ObjectComponentBehaviourMonoBehaviourRoom
- Implements
- Inherited Members
-
MonoBehaviour.IsInvoking()MonoBehaviour.CancelInvoke()MonoBehaviour.StopCoroutine(Coroutine)MonoBehaviour.StopAllCoroutines()MonoBehaviour.useGUILayoutBehaviour.enabledBehaviour.isActiveAndEnabledComponent.GetComponent<T>()Component.TryGetComponent<T>(out T)Component.GetComponentInChildren<T>()Component.GetComponentsInChildren<T>()Component.GetComponentInParent<T>()Component.GetComponentsInParent<T>()Component.GetComponents<T>()Component.transformComponent.gameObjectComponent.tagObject.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.nameObject.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
Cameras
Gets a IReadOnlyCollection<T> of Camera in the Room.
public IReadOnlyCollection<Camera> Cameras { get; }
Property Value
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
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
Name
Gets the Room name.
public string Name { get; }
Property Value
NearestRooms
Gets a IReadOnlyList<T> of Room around the Room.
public IReadOnlyList<Room> NearestRooms { get; }
Property Value
Pickups
Gets a IEnumerable<T> of Pickup in the Room.
public IEnumerable<Pickup> Pickups { get; }
Property Value
Players
Gets a IEnumerable<T> of Player in the Room.
public IEnumerable<Player> Players { get; }
Property Value
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
Gets a IReadOnlyCollection<T> of RoomLightController in the Room.
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
Transform
Gets the Room UnityEngine.Transform.
public Transform Transform { get; }
Property Value
- Transform
Type
Gets the RoomType.
public RoomType Type { get; }
Property Value
Windows
Gets a IReadOnlyCollection<T> of Window in the Room.
public IReadOnlyCollection<Window> Windows { get; }
Property Value
Zone
Gets the ZoneType in which the room is located.
public ZoneType Zone { get; }
Property Value
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
floatDuration in seconds, or
-1
for permanent blackout.lockType
DoorLockTypeDoorLockType 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
GameObjectThe GameObject inside the room.
Returns
- Room
The Room that the GameObject is located inside. Can be null.
- See Also
Get(RoomType)
public static Room Get(RoomType roomType)
Parameters
Returns
Get(ZoneType)
Gets a IEnumerable<T> of Room given the specified ZoneType.
public static IEnumerable<Room> Get(ZoneType zoneType)
Parameters
Returns
Get(RoomIdentifier)
Gets a Room from a given Identifier.
public static Room Get(RoomIdentifier roomIdentifier)
Parameters
roomIdentifier
RoomIdentifierThe Identifier to search with.
Returns
Get(RelativePosition)
Gets a Room given the specified RelativePositioning.RelativePosition.
public static Room Get(RelativePosition position)
Parameters
position
RelativePositionThe RelativePositioning.RelativePosition to search for.
Returns
Get(RoomLightController)
Gets a Room from a given MapGeneration.RoomIdentifier.
public static Room Get(RoomLightController flickerableLightController)
Parameters
flickerableLightController
RoomLightControllerThe RoomLightController to search with.
Returns
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
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
Vector3The UnityEngine.Vector3 to search for.
Returns
LocalPosition(Vector3)
Returns the local space position, based on a world space position.
public Vector3 LocalPosition(Vector3 position)
Parameters
position
Vector3World 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
floatDuration in seconds, or
-1
for permanent lockdown.lockType
DoorLockTypeDoorLockType of the lockdown.
- See Also
Random(ZoneType)
Gets a random Room.
public static Room Random(ZoneType zoneType = ZoneType.Unspecified)
Parameters
Returns
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
floatDuration 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
Vector3Local position.
Returns
- Vector3
World position, based on the room.