Skip to content

Class: Room ​

  • Namespace: Global
  • Assembly: Dew.Core.dll
  • Inheritance / Derived: DewNetworkBehaviour → SingletonDewNetworkBehaviour → Room
csharp
[RequireComponent(typeof(RoomMap))]
[RequireComponent(typeof(RoomMonsters))]
[RequireComponent(typeof(RoomProps))]
[RequireComponent(typeof(RoomRifts))]
[RequireComponent(typeof(RoomRewards))]
[RequireComponent(typeof(RoomModifiers))]
[RequireComponent(typeof(RoomEditorMaintenance))]
public class Room : SingletonDewNetworkBehaviour<Room>, ILogicUpdate

Fields ​

NameDeclarationDescription
availableCameraAnglespublic float[] availableCameraAngles
ClientEvent_OnFootsteppublic SafeAction&lt;Entity&gt; ClientEvent_OnFootstepCalled everywhere everytime a footstep is done on an entity.
ClientEvent_OnPrepareAsNonHostileRoompublic SafeAction ClientEvent_OnPrepareAsNonHostileRoom
ClientEvent_OnRoomClearpublic SafeAction ClientEvent_OnRoomClear
ClientEvent_OnRoomStartpublic SafeAction ClientEvent_OnRoomStart
ClientEvent_WaypointLockedpublic SafeAction&lt;Room_Waypoint&gt; ClientEvent_WaypointLocked
ClientEvent_WaypointUnlockedpublic SafeAction&lt;Room_Waypoint&gt; ClientEvent_WaypointUnlocked
defaultSurfacepublic DewSurfaceData defaultSurface
metadata`[ReadOnly]
public DewRoomMetadata metadata`
musicpublic DewMusicItem music
onRemoveObstaclespublic SafeAction onRemoveObstaclesThis is called on server when this room needs to clear any progression obstacles.e.g. Barriers, Locked Shrines of Despair
onRoomClear`[FoldoutGroup("Events", 0)]
public UnityEvent onRoomClear`Called on server when all combat sections are cleared / a hero steps on clear condition section.
openRoomExitOnClear`[ToggleLeft]
public bool openRoomExitOnClear`
playerPathablePointspublic readonly List&lt;Vector3&gt; playerPathablePointsAvailable everywhere.

Properties ​

NameDeclarationDescription
didClearRoompublic bool didClearRoom { get; }Available on server.
didRemoveObstaclespublic bool didRemoveObstacles { get; set; }Available on server.
heroSpawnPospublic Vector3 heroSpawnPos { get; }Available on server.
heroSpawnRotpublic Quaternion heroSpawnRot { get; }Available on server.
isActivepublic bool isActive { get; }
isNonHostileRoompublic bool isNonHostileRoom { get; set; }Is this room modified to be a non-hostile room? Available everywhere.
isRevisitpublic bool isRevisit { get; set; }Are we revisiting this room? Available everywhere.
mappublic RoomMap map { get; }
modifierspublic RoomModifiers modifiers { get; }
monsterspublic RoomMonsters monsters { get; }
numOfActivatedCombatAreaspublic int numOfActivatedCombatAreas { get; }
propspublic RoomProps props { get; }
rewardspublic RoomRewards rewards { get; }
riftspublic RoomRifts rifts { get; }
sectionspublic IList&lt;RoomSection&gt; sections { get; }
unlockedWaypointspublic IReadOnlyList&lt;Room_Waypoint&gt; unlockedWaypoints { get; }

Methods ​

AddUnlockedWaypoint(Room_Waypoint) ​

csharp
public void AddUnlockedWaypoint(Room_Waypoint waypoint)

Parameters:

NameTypeDescription
waypointRoom_Waypoint

Awake() ​

csharp
protected override void Awake()

ClearRoom() ​

csharp
public void ClearRoom()

GetFinalSection() ​

Get a section closest to exit rift.

csharp
public RoomSection GetFinalSection()

Returns: RoomSection

GetHeroSpawnPosition() ​

Get randomly offset spawn position.

csharp
public Vector3 GetHeroSpawnPosition()

Returns: UnityEngine.Vector3

GetHeroSpawnRotation() ​

Get spawn rotation.

csharp
public Quaternion GetHeroSpawnRotation()

Returns: UnityEngine.Quaternion

GetRoomRandom(int) ​

Get a random instance for this room. States for these random instances are persistent.

csharp
public DewRandom GetRoomRandom(int offset)

Parameters:

NameTypeDescription
offsetint

Returns: DewRandom

GetSectionFromWorldPos(Vector3) ​

csharp
public RoomSection GetSectionFromWorldPos(Vector3 pos)

Parameters:

NameTypeDescription
posUnityEngine.Vector3

Returns: RoomSection

OnLateStart() ​

csharp
public override void OnLateStart()

OnLateStartServer() ​

csharp
public override void OnLateStartServer()

OnStartClient() ​

csharp
public override void OnStartClient()

OnStartServer() ​

csharp
public override void OnStartServer()

OverrideHeroSpawn(Vector3, Quaternion) ​

csharp
public void OverrideHeroSpawn(Vector3 pos, Quaternion rot)

Parameters:

NameTypeDescription
posUnityEngine.Vector3
rotUnityEngine.Quaternion

RemoveCombat(bool) ​

Disables enemy spawns, and removes any existing enemies or camps.It is recommended to call this with Dew.CallDelayed() if you're calling it in RoomModifierBase.OnCreate().

csharp
public void RemoveCombat(bool clearRoomOnEnteringLastSection)

Parameters:

NameTypeDescription
clearRoomOnEnteringLastSectionbool

RemoveObstacles() ​

Remove any kind of progression-blocking obstacles, like barriers, locked teleport shrines and such.It is recommended to call this with Dew.CallDelayed() if you're calling it in RoomModifierBase.OnCreate().

csharp
public void RemoveObstacles()

RemoveUnlockedWaypoint(Room_Waypoint) ​

csharp
public void RemoveUnlockedWaypoint(Room_Waypoint waypoint)

Parameters:

NameTypeDescription
waypointRoom_Waypoint

SetCameraAngleIndex_Local(int) ​

csharp
public void SetCameraAngleIndex_Local(int index)

Parameters:

NameTypeDescription
indexint

StartRoom() ​

csharp
public void StartRoom()

StopRoom() ​

csharp
public void StopRoom()

SyncCameraAngle() ​

csharp
public void SyncCameraAngle()

Maintained by the Shape of Dreams Modding Community