Пример #1
0
        //Spells
        public ASpell InstantiateSpell(ref ASpell spell)
        {
            ASpell tmp = Instantiate(spell);

            tmp.Init("PlayerTeam", currentUnit.gameObject);
            return(tmp);
        }
Пример #2
0
 public void CancelCast()
 {
     if (currentSpell != null)
     {
         currentSpell.Cancel();
         currentSpellIndex = -1;
     }
     currentSpell = null;
     casting      = false;
 }
Пример #3
0
 private void LaunchSpell()
 {
     currentSpell.Launch();
     currentSpellBook[currentSpellIndex].spellCooldown = currentSpell.cooldown;
     UnitPortrait.SpellSlot spellSlot = player.currentUnit.portrait.spellSlots[currentSpellIndex];
     spellSlot.mask.gameObject.SetActive(true);
     spellSlot.coolDown.gameObject.SetActive(true);
     spellSlot.coolDown.text = currentSpell.cooldown.ToString();
     currentSpell            = null;
     casting           = false;
     currentSpellIndex = -1;
 }
Пример #4
0
 private void StartCasting(int index)
 {
     if (currentSpellBook[index].spellCooldown > 0f)
     {
         return;
     }
     currentSpell = player.InstantiateSpell(ref currentSpellBook[index].spellRef);
     casting      = true;
     useCursor    = currentSpell.useCursor;
     if (player.useJoyStick)
     {
         player.ResetJoystickCursor();
     }
     currentSpellIndex = index;
     if (currentSpell.castType == ASpell.CastType.QuickCast)
     {
         LaunchSpell();
     }
 }