Beispiel #1
0
 public void PlayerDecide(RSPVariants decision)
 {
     foreach (var button in buttons)
     {
         button.interactable = false;
     }
     playerIcons[decision].SetActive(true);
 }
Beispiel #2
0
    private IEnumerator Waiter()
    {
        yield return(new WaitForSeconds(1f));

        aiChoosed = ai.Choose();
        AIChoosedEvent?.Invoke(aiChoosed);
        yield return(new WaitForSeconds(1f));

        decider.Decide(playerChoosed, aiChoosed);
    }
Beispiel #3
0
 public void Decide(RSPVariants player, RSPVariants ai)
 {
     if (player == ai)
     {
         gameManager.ChangeStateChanged(Game.Draw);
     }
     else
     {
         if (player == RSPVariants.Rock && ai == RSPVariants.Scissors ||
             player == RSPVariants.Scissors && ai == RSPVariants.Paper ||
             player == RSPVariants.Paper && ai == RSPVariants.Rock)
         {
             scoreController.IncreaseScore(PlayerType.Player);
             gameManager.ChangeStateChanged(Game.Win);
         }
         else
         {
             scoreController.IncreaseScore(PlayerType.AI);
             gameManager.ChangeStateChanged(Game.Loose);
         }
     }
 }
Beispiel #4
0
 public void AIDecide(RSPVariants decision)
 {
     PlayAudio();
     aiIcons[decision].SetActive(true);
 }
Beispiel #5
0
 internal void SetPlayerDecision(RSPVariants variant)
 {
     playerChoosed = variant;
     PlayerChoosedEvent?.Invoke(playerChoosed);
     StartCoroutine(Waiter());
 }