Exemplo n.º 1
0
 public void Fire()//Index for weapon yadadada
 {
     if (SS.Energy >= ShipInfo.LaserCost && CooledDown)
     {
         CooledDown = false;
         SS.Drain(ShipInfo.LaserCost);
         GameObject Projectile = Instantiate(TempProjectile, GunPos.position, Quaternion.identity);
         Projectile.GetComponent <Projectile>().Damage = ShipInfo.LaserDamage;
         Projectile.GetComponent <Projectile>().Team   = SS.Team;
         Projectile.transform.SetParent(this.transform.parent);
         //Projectile.GetComponent<Rigidbody>().AddForce(GunPos.forward * FireForce);
         Projectile.GetComponent <Rigidbody>().velocity = GunDirection * ShipInfo.LaserVelocity;
         Invoke("GunCool", ShipInfo.LaserCoolDownTime);
     }
 }