public void RaySpellEffect(RaySpell spell) { Vector3 direction = Camera.main.transform.forward; Vector3 startPos = Camera.main.transform.position + direction; GameObject gameObj = Instantiate(spell.projectilePrefab, startPos, Camera.main.transform.rotation); SpellProjectile projectile = gameObj.GetComponent <SpellProjectile>(); projectile.InitProjectile(spell); }
public void InitProjectile(RaySpell spell) { this.spell = spell; }