예제 #1
0
    public void Shoot()
    {
        if (!coolingDown)
        {
            RayBullet bullet = Instantiate(bulletPrefab, bulletEmmitter.position,
                                           bulletEmmitter.rotation).GetComponent <RayBullet>();
            bulletsShot++;

            bullet.bulletSpeed = bulletSpeed;
            bullet.Damage      = Damage;

            Destroy(bullet, bulletLifeTime);

            if (bulletsShot >= maxBullets)
            {
                coolingDown = true;
                bulletsShot = 0;
            }
        }
    }
예제 #2
0
 public void SetRayBullet(RayBullet value)
 {
     rayBullet = value;
 }
예제 #3
0
 private static void CreateInstances()
 {
     rayBullet = ScriptableObject.CreateInstance <RayBullet>();
     physicsBulletProperties = new PhysicsBulletProperties();
     grenadeProperties       = new GrenadeProperties();
 }
예제 #4
0
 public void SetBullet(RayBullet value)
 {
     bullet = value;
 }