private void OnCharacterDieInRoom(Room.CharacterDied everyoneDiedEvent) { var room = everyoneDiedEvent.Room; if (room.GetRoomType() != _roomType) { return; } var aliveCharacter = _crewViews.FirstOrDefault(x => !x.IsDead); if (aliveCharacter != null) { aliveCharacter.MarkAsDead(true); } }
private void OnCharacterDieInRoom(Room.CharacterDied characterDied) { var type = characterDied.Room.GetRoomType(); if (type == Room.RoomType.AlienMotherRoom) { return; } _currentCharacterCount--; if (_currentCharacterCount <= 0) { _leftBar.fillAmount = 0; _rightBar.fillAmount = 0; _progressAmount.text = "0"; return; } var fillAmount = _currentCharacterCount / _charactersCount; _progressAmount.text = string.Format("{0}", Mathf.RoundToInt(fillAmount * 100)); _leftBar.fillAmount = fillAmount; _rightBar.fillAmount = fillAmount; }