/// <summary>
 /// chiamata quando vierne premuto il bottone, fa terminare la check phase
 /// Non ha senso averlo,ma senno andava in loop continuo
 /// </summary>
 public void EndCheck()
 {
     if (CurrentState.GetType().Name == "CheckPhase")
     {
         CheckPhase tempCheckPhase = CurrentState as CheckPhase;
         tempCheckPhase.RestartGameplay();
         foreach (CardView item in GamePlayManager.I.GetCardsInScene())
         {
             if (item.Data.Life <= 0)
             {
                 Destroy(item.gameObject);
             }
         }
         if (next.GetComponentInChildren <Text>())
         {
             next.GetComponentInChildren <Text>().text = "Turno";
         }
     }
     if (GamePlayManager.I.Players[0].Life <= 0)
     {
         PlayerIsDead(GamePlayManager.I.Players[0]);
         Debug.Log("GameOver Player 1");
     }
     if (GamePlayManager.I.Players[1].Life <= 0)
     {
         PlayerIsDead(GamePlayManager.I.Players[1]);
         Debug.Log("GameOver Player 2");
     }
 }
Exemplo n.º 2
0
    private void Start()
    {
        star1.gameObject.SetActive(false);
        star2.gameObject.SetActive(false);
        star3.gameObject.SetActive(false);
        star1.GetComponent <Image>().sprite = starSilve;
        star2.GetComponent <Image>().sprite = starSilve;
        star3.GetComponent <Image>().sprite = starSilve;
        text.SetActive(true);

        Me        = GetComponent <Image>();
        Me.sprite = Phase3;

        checkPhase = GetComponentInParent <CheckPhase>();

        starController = GetComponentInParent <StarController>();
    }