public void CastHealingSpell(GameObject target) { Spell castingSpell = new Spell("Heal", SpellType.Healing); castingSpell.TargetedCast(target); }
public void CastFireballSpell(GameObject target) { Spell castingSpell = new Spell("Fireball", SpellType.Attack); castingSpell.TargetedCast(target); }In this example, we create a new Spell object with the name "Fireball" and the type "Attack". We then call the TargetedCast method on this spell, passing in the GameObject of the enemy target that we want to cast the spell on. The package library that this method belongs to is commonly found in game development platforms like Unity, Unreal Engine, and MonoGame.