void shootFire()
    {
        //Shoot Fireball

        FireballController projectile = ObjectFactory.CreateFireball(10f, fireballRadius, fireballDamage, fireballStatus, fireballSize, fireballSpeed);

        projectile.transform.position = transform.position + transform.forward;
        projectile.GetComponent <Rigidbody>().velocity = cam.ScreenPointToRay(Input.mousePosition).direction *fireballSpeed;
    }
Example #2
0
    public FireballController PrefabInstantiate(float damage, Vector3 position, Vector2 impulse)
    {
        FireballController fireball = ((GameObject)GameObject.Instantiate(gameObject)).GetComponent <FireballController>();

        fireball.Damage             = damage;
        fireball.transform.position = position;
        fireball.GetComponent <Rigidbody2D>().AddForce(impulse, ForceMode2D.Impulse);
        return(fireball);
    }