Skip to main content

RoomExtensions

static class ThaumielMapEditor.API.Extensions

Overview​

Methods​

SignatureReturnsDescription
GetClosestRoomToPosition(Vector3)RoomGets the closest LabApi.Features.Wrappers.Room to the `UnityEngine.Vector3``po…
GetMaps(Room)IEnumerable<MapData>Gets all the spawned maps in this LabApi.Features.Wrappers.Room.
GetSchematics(Room)IEnumerable<SchematicData>Gets all the spawned schematics in this LabApi.Features.Wrappers.Room.
LocalPosition(Room, Vector3)Vector3Returns the local space position, based on a world space position.
WorldPosition(Room, Vector3)Vector3Returns the World position, based on a local space position.

Methods​

GetClosestRoomToPosition​

GetClosestRoomToPosition
public Room GetClosestRoomToPosition(Vector3 pos)

Gets the closest LabApi.Features.Wrappers.Room to the UnityEngine.Vector3``pos

Parameters​

NameTypeDescription
posVector3The position to get the closest room from

Returns​

Room — LabApi.Features.Wrappers.Room if a room was found else returns null if no room was found


GetMaps​

GetMaps
public IEnumerable<MapData> GetMaps(Room room)

Gets all the spawned maps in this LabApi.Features.Wrappers.Room.

Parameters​

NameTypeDescription
roomRoom

Returns​

IEnumerable<MapData>


GetSchematics​

GetSchematics
public IEnumerable<SchematicData> GetSchematics(Room room)

Gets all the spawned schematics in this LabApi.Features.Wrappers.Room.

Parameters​

NameTypeDescription
roomRoom

Returns​

IEnumerable<SchematicData>


LocalPosition​

LocalPosition
public Vector3 LocalPosition(
Room room,
Vector3 position
)

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

Parameters​

NameTypeDescription
roomRoomThe room instance this method extends.
positionVector3World position.

Returns​

Vector3 — Local position, based on the room.


WorldPosition​

WorldPosition
public Vector3 WorldPosition(
Room room,
Vector3 offset
)

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

Parameters​

NameTypeDescription
roomRoomThe room instance this method extends.
offsetVector3Local position.

Returns​

Vector3 — World position, based on the room.