Пример #1
0
 public void shootSpells()
 {
     if (timeBTWShots <= 0)
     {
         if (Input.GetMouseButtonDown(0) && HeathManaBar.currentMana > 1 && !SpawnLogic.inBetweenRounds)
         {
             Instantiate(projectile, shotPoint.position, transform.rotation);
             //Mana -= 2;
             HeathManaBar.reduceMana(1);
             timeBTWShots = startTimeBTWShots;
             isShoot      = true;
             StartCoroutine(WaitForAttackAnimation());
             spellShoot.Play();
         }
     }
     else
     {
         timeBTWShots -= Time.deltaTime;
     }
     //Mana = HeathManaBar.currentMana;
 }
Пример #2
0
 public void WindSpell()
 {
     if (timeBTWShots <= 0)
     {
         if (Input.GetMouseButtonDown(0) && HeathManaBar.currentMana > 3 && !SpawnLogic.inBetweenRounds)
         {
             currentWind = Instantiate(Wind, shotPoint.position, transform.rotation);
             //currentWind.AddForce(Vector2.up * 5000, ForceMode2D.Impulse);
             currentWind.velocity = dif * speed; // speed variable
             // Mana -= 3;
             HeathManaBar.reduceMana(3);
             timeBTWShots = startTimeBTWShots;
             isShoot      = true;
             StartCoroutine(WaitForAttackAnimation());
             spellShoot.Play();
         }
     }
     else
     {
         timeBTWShots -= Time.deltaTime;
     }
     //Mana = HeathManaBar.currentMana;
 }