Exemplo n.º 1
0
        private IEnumerator StartGame()
        {
            yield return(new WaitForSeconds(movementTime));

            bool win;
            int  winner;
            int  speedPotion = 0;

            do
            {
                waitForSpells = new WaitForSpells(players);
                rockPaperSpellView.EnableCast(true);
                yield return(waitForSpells);

                rockPaperSpellView.EnableCast(false);
                Model.RockPaperSpell.SetTargetsAndSpells(waitForSpells.SpellTargets);
                bool first = true;
                for (int i = speedPotion; i != speedPotion || first; i = i < players - 1 ? i + 1 : 0)
                {
                    yield return(new WaitForSeconds(1.25f));

                    first = false;
                    if (Model.RockPaperSpell.Wizards[i].CastSpell())
                    {
                        yield return(new WaitForSeconds(movementTime));
                    }
                }
                speedPotion = speedPotion < players - 1 ? speedPotion + 1 : 0;
                Model.RockPaperSpell.SplitLoot();
                win = Model.RockPaperSpell.CheckWin(out winner);
                yield return(new WaitForSeconds(1));
            } while (!win);
            Debug.Log(winner);
        }
Exemplo n.º 2
0
 private void RpcEnableCast(bool value)
 {
     rockPaperSpellView.EnableCast(value);
 }