예제 #1
0
 public void ConfirmTie()
 {
     OnRequestTie();
     StartCoroutine(TieWait());
     TieConfirmWindow.SetActive(false);
     TieWaitWindow.SetActive(true);
 }
예제 #2
0
    IEnumerator TieWait()
    {
        int    length = 600;
        string msg    = TieWaitText.text;

        recievedTieconfirm = false;
        for (int i = 0; i < length; i++)
        {
            if (recievedTieconfirm)
            {
                if (i % 12 == 0)
                {
                    TieWaitText.text = "." + TieWaitText.text + ".";
                }
            }
            if (i % 60 == 0)
            {
                TieWaitText.text = msg;
            }

            yield return(new WaitForEndOfFrame());
        }

        if (recievedTieconfirm)
        {
            CustomDebug.Log("Confirmed Tie");
            TieWaitText.text = "Tie Confirmed";
            yield return(new WaitForSeconds(1f));

            Application.LoadLevel(0);
        }
        else
        {
            CustomDebug.Log("Tie Declined");
            TieWaitText.text = "No Tie keep playing";
            yield return(new WaitForSeconds(1f));

            TieWaitText.text = msg;
            TieWaitWindow.SetActive(false);
        }
    }