public override void Initialize(GameObject obj)
 {
     launcher = obj.GetComponent<ProjectileShootTriggerable>();
     //launcher.bulletPrefab = bullet;
     launcher.burstOfBullets = burstOfBullets;
     launcher.castTime = castTime;
     //launcher.projectileForce = projectileForce;
    // launcher.projectile = projectile;
 }
Example #2
0
    private ProjectileShootTriggerable launcher; //Variable that will contain the ProjectileShootTriggerable script

    //This is the override method for Initalizeing the ability (This takes a GameObject called obj.... this is where the WeaponHolders are passed in to access the correct script etc.)
    public override void Initialize(GameObject obj)
    {
        launcher = obj.GetComponent <ProjectileShootTriggerable>(); //Sets the launcher variable to the ProjectileShootTriggerable script on the passed gameObject

        launcher.projectileForce = projectileForce;                 //This sets the launchers projectile force to the abilities projectile force variable

        launcher.projectile = projectile;                           //This will set the launchers (WeaponHolder's ProjectileShootTriggerable) projectile to the projectile assigned to the scriptable object (Again this is the prefab that will be spawned when a ability is used)

        launcher.projectile.useGravity = useGravity;                //This sets the projectile's gravity bool to the abilities useGravity bool
    }
 public override void Initialize(GameObject obj)
 {
     launcher = obj.GetComponent <ProjectileShootTriggerable>();
     launcher.projectileForce = projectileForce;
     launcher.projectile      = projectile;
 }