private IEnumerator DoSolved() { Solved = true; OnSolved?.Invoke(); yield return(new WaitForSeconds(0.75f)); CameraController.Instance.ShakeOn(); Room3FinalLadder.Instance.Move(); yield return(new WaitForSeconds(Room3FinalLadder.Instance.MoveTime)); CameraController.Instance.ShakeOff(); foreach (var character in Characters) { character.Sleep(); } ScreenFlash.Flash(FlashTime); GameController.Instance.MoreColor(); }
public SharkDto OnKeyPress(string user, string key) { user ??= ""; var oldCorrectCharacters = GetCorrectCharactersForUser(user); var newCorrectCharacters = GetNewCorrectCharacters(key, oldCorrectCharacters); CorrectCharactersByPlayer[user] = newCorrectCharacters; var newGroupCorrectCharacters = CorrectCharactersByPlayer.Values.Max(); var oldGroupCorrectCharacters = SharkDto.CorrectCharacters; SharkDto.CorrectCharacters = newGroupCorrectCharacters; var sharkChanged = oldGroupCorrectCharacters != newGroupCorrectCharacters; if (SharkDto.IsSolved) { OnSolved?.Invoke(this, _game); } return(sharkChanged ? SharkDto : null); }