public override void ShowNozzleEffect(WeaponFireData data) { if (data.shouldShowNozzleEffect) { nozzleEffect.transform.position = bulletSpawn.transform.position; nozzleEffect.Play(); nozzleEffect.Emit(10); } }
public void RpcClientPostFire(WeaponFireData data) { BaseWeapon weapon = gunInstances[currentGunIndex].GetComponent <BaseWeapon>(); weapon.ShowNozzleEffect(data); if (data.shouldShowNozzleEffect) { weaponAudioSources[currentGunIndex].PlayOneShot(weapon.weaponFireSound); } if (weapon.GetWeaponEnum() == WeaponEnum.BeamWeapon && weapon.GetBulletsRemaining() > 0) { weaponAudioSources[currentGunIndex].loop = true; weaponAudioSources[currentGunIndex].clip = weapon.weaponFireSound; weaponAudioSources[currentGunIndex].Play(); } }
public override void ShowNozzleEffect(WeaponFireData data) { if (data.shouldShowNozzleEffect) { beam.SetPosition(0, bulletSpawn.transform.position); beam.SetPosition(1, data.hitPos); // Align the particle effect with the beam direction nozzleEffect.transform.right = beam.GetPosition(1) - beam.GetPosition(0); nozzleEffect.transform.position = beam.GetPosition(0); hitEffect.transform.position = beam.GetPosition(1); hitEffect.Play(); nozzleEffect.Play(); //beam.enabled = true; } else { FireHoldRelease(); } }
public virtual void ShowNozzleEffect(WeaponFireData data) { }