/// <summary> /// Activate this instance. /// </summary> public override void Activate() { // Debug.Log ("Activate Room: " + this.Key); // Disable the active room //if (_activeRoom != null) {_activeRoom.Deactivate ();} // Enable this object Enable (); // Set the active room to this _activeRoom = this; // Apply the fog settings of this room _fogSettings.ApplyFog (); // Attempt to activate conditional object - most of these will be lighting conditions UpdateConditionalObjects (); foreach (Room room in GameObject.FindObjectsOfType<Room>()) { if(room != this) { room.Deactivate(); } } // Raised the room activated event if (RoomActivated != null) { RoomActivated.Invoke(this, new RoomEventArgs("blank")); } }
/// <summary> /// Deactivate this instance. /// </summary> public override void Deactivate() { // Debug.Log ("Deactivating Room: " + this.Key); Disable (); if (this.IsActive) { _activeRoom = null; } }
/// <summary> /// Sets the properties. This will only happen in the editor. /// </summary> public void SetProperties(string key, bool doesSpawnPC, CameraNode cameraNode, Room room) { #if UNITY_EDITOR UnityEditor.EditorUtility.SetDirty(this); #endif //_key = key; OnRenameKey (key); _spawnActivePC = doesSpawnPC; _cameraNode = cameraNode; _room = room; }