private void OnDoorClose(PolarizedDoor sender, int playerSide) { if (playerSide != 0) { if (playerSide > 0) { if (sender.PositiveDisableObjects.Contains(this)) { SetVisible(false); IsPlayerInRoom = false; } } else { if (sender.NegativeDisableObjects.Contains(this)) { SetVisible(false); IsPlayerInRoom = false; } } } else { if (!IsPlayerInRoom) { if (Doors.All(d => d.State == PolarizedDoor.DoorState.Closed)) { SetVisible(false); } } } }
private void OnOpenDoor(PolarizedDoor sender, int playerSide) { if (playerSide != 0) { SetVisible(true); IsPlayerInRoom = true; } else { if (sender.AdjacentRooms.Any(r => r.IsPlayerInRoom)) { SetVisible(true); } } }