public void UpdateItem(Gesture?opponentChoise, Gesture?playerChoise, GameResult state) { UpdateResultImage(state); if (opponentChoise.HasValue) { switch (opponentChoise.Value) { case Gesture.Scissors: anotherPlayerChoiseIcon.sprite = ScissorsSprite; break; case Gesture.Rock: anotherPlayerChoiseIcon.sprite = RockSprite; break; case Gesture.Paper: anotherPlayerChoiseIcon.sprite = PaperSprite; break; } } else { anotherPlayerChoiseIcon.sprite = UndefinedSprite; } if (playerChoise.HasValue) { switch (playerChoise.Value) { case Gesture.Scissors: thisPlayerChoiseIcon.sprite = ScissorsSprite; break; case Gesture.Rock: thisPlayerChoiseIcon.sprite = RockSprite; break; case Gesture.Paper: thisPlayerChoiseIcon.sprite = PaperSprite; break; } } else { thisPlayerChoiseIcon.sprite = UndefinedSprite; } currentResultState = state; anotherPlayerChoiseText.text = opponentChoise.HasValue ? RockPaperScissorsGestureEnumConverter.ConvertTo(opponentChoise.Value).ToUpper() : "OVERDUED"; thisPlayerChoiseText.text = playerChoise.HasValue ? RockPaperScissorsGestureEnumConverter.ConvertTo(playerChoise.Value).ToUpper() : "OVERDUED"; }
void GameComplete(MatchContainer match, GameContainer game) { if (!gameObject.activeSelf || TournamentManager.Instance.CurrentTournament == null || !match.Tournament.Equals(TournamentManager.Instance.CurrentTournament.Id)) { return; } AudioManager.Instance.StopPlaying(); StopTimer(); buttonsObject.SetActive(false); if (game.MeGesture.HasValue) { playerHand.SetTrigger(RockPaperScissorsGestureEnumConverter.ConvertTo(game.MeGesture.Value)); } if (game.OpponentGesture.HasValue) { opponentHand.SetTrigger(RockPaperScissorsGestureEnumConverter.ConvertTo(game.OpponentGesture.Value)); } StartCoroutine(BackToIdleCoroutine(2f, match, game)); }