Exemplo n.º 1
0
    private IEnumerator UpdateWords()
    {
        while (PhotonNetwork.InRoom)
        {
            yield return(new WaitForSeconds(0.1f));

            for (int i = ActiveWordSet.Count() - 1; i >= 0; i--)
            {
                FallingWord word = ActiveWordSet._items[i];

                if (!word)
                {
                    continue;
                }

                if (word.BrokeCombo && PhotonNetwork.LocalPlayer.ActorNumber == ValidPlayerID)
                {
                    Score.BreakCombo();
                    audioSource.PlayOneShot(ComboBreakSound);
                }

                if (word.RequiresDeletion)
                {
                    ActiveWordSet.Remove(word);
                    Destroy(word.gameObject);
                }
            }
        }
    }