public void SetInstalledFurniture(InstalledFurniture installedFurniture) { if (this.installedFurniture != null) { Debug.LogWarning("Warning: Trying to change installedFurniture without removing existing first."); } this.installedFurniture = installedFurniture; if (BuildModeController.Instance.furnitureTypes.ContainsKey(installedFurniture.GetFurnitureType())) { // If tile is not walkable if (BuildModeController.Instance.furnitureTypes[installedFurniture.GetFurnitureType()].walkable == false) { isWalkable = false; roomType = null; RoomSpriteController.Instance.UpdateRoom(this); } else { isWalkable = true; } } else { isWalkable = true; } FurnitureSpriteController.Instance.UpdateFurniture(this); }
public InstalledFurniture RemoveInstalledFurniture() { // Should only be accessed by a Builder after their RemoveFurniture job is complete. // Use BuildModeController to handle the RemoveFurniture job. InstalledFurniture temp = installedFurniture; installedFurniture = null; isWalkable = true; FurnitureSpriteController.Instance.UpdateFurniture(this); return(temp); }