Exemplo n.º 1
0
 public void OnBeginDrag(PointerEventData eventData)
 {
     if (GetComponent <Button>().interactable == true)
     {
         if (byRegion && CanBeUsed() && spellImage.DummyUnit != null)
         {
             regionSpell = Instantiate <RegionSpell>(spellImage.DummyUnit, BattleControll.battleControll.dummyParent);
         }
     }
 }
Exemplo n.º 2
0
 public void OnEndDrag(PointerEventData eventData)
 {
     if (regionSpell != null)
     {
         if (byRegion)
         {
             if (CanBeUsed())
             {
                 if (regionSpell.ApplyRegion(spellImage, spellInBattle))
                 {
                     regionSpell = null;
                     BattleControll.heroLogic.Energy -= spellImage.EnergyCost;
                     BattleControll.heroLogic.Mana   -= spellImage.ManaCost;
                     spellInBattle.GoReload(spellImage.ReloadTurns);
                 }
             }
             else
             {
                 Destroy(regionSpell);
             }
         }
     }
 }