private void FireProjectile() { Vector2 vector = new Vector2(animator.GetFloat("moveX"), animator.GetFloat("moveY")); if (manaFloat >= fireBall.manaCost) { manaFloat -= fireBall.manaCost; fireBall = Instantiate(projectile, transform.position, Quaternion.identity).GetComponent <FireBall>(); fireBall.Create(vector, ProjectileDirection()); } }
public void NewSpells(int magic) { MP += (4 * Lvl); //put higher level spells on top lower on bottom, always return at the bottom of each if. if (magic >= 3) { Console.WriteLine("You have gained the wisdom of the Fire Ball Spell, do you wish to learn it? [y/n]"); string r = Console.ReadLine(); if (r == "y") { Spell fb = new FireBall(); fb.Create(); LearnSpell(fb); } return; } }