Пример #1
0
        void ChangePlayerHero(ChooseHero hero)
        {
            if (!isPlayerCanChoose)
            {
                return;
            }
            if (currentPlayerHero != null)
            {
                currentPlayerHero.SetPlayer(1, false);
            }
            hero.SetPlayer(1, true);
            currentPlayerHero = hero;

            PlayerHeroImage.sprite = currentPlayerHero.HeroSprite;
        }
Пример #2
0
        void ChooseAIHero()
        {
            foreach (var cur in heroes)
            {
                if (cur.HeroName == HeroesNames.Random)
                {
                    if (currentAIHero != null)
                    {
                        currentAIHero.SetPlayer(2, false);
                    }
                    cur.SetPlayer(2, true);
                    currentAIHero = cur;

                    AIHeroImage.sprite = currentAIHero.HeroSprite;
                }
            }
        }