示例#1
0
 void ResetEnterColors(ChooseHero hero)
 {
     if (!isPlayerCanChoose)
     {
         return;
     }
     hero.SetBorderColor(defaultColor);
 }
示例#2
0
 void SetEnterColor(ChooseHero hero)
 {
     if (!isPlayerCanChoose)
     {
         return;
     }
     hero.SetBorderColor(playerOverColor);
 }
示例#3
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;
        }
示例#4
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;
                }
            }
        }
示例#5
0
 void Awake()
 {
     isPlayerCanChoose      = true;
     PlayerHeroImage.sprite = UnknownHeroSprite;
     AIHeroImage.sprite     = UnknownHeroSprite;
     currentPlayerHero      = null;
     currentAIHero          = null;
     foreach (var cur in heroes)
     {
         cur.HidePlayerImages();
         cur.SetBorderColor(defaultColor);
         cur.OnClick      += ChangePlayerHero;
         cur.OnMouseEnter += SetEnterColor;
         cur.OnMouseExit  += ResetEnterColors;
     }
     ChooseAIHero();
     HideWarningMessageBox();
 }