public void SpawnBulletTrailVFX(Vector3 start, Vector3 end) { var bulletTrail = PoolSystem.GetInstance <LineRenderer>(_bulletTrailVFX); bulletTrail.SetPosition(0, start); bulletTrail.SetPosition(1, end); bulletTrail.gameObject.SetActive(true); }
public void PlaySFXSource(AudioClip clip, Vector3 hitPosition, Vector3 normal) { if (clip) { var source = PoolSystem.GetInstance <AudioSource>(_sfxSource); float pitch = Random.Range(0.8f, 1.2f); source.gameObject.transform.position = hitPosition; source.gameObject.transform.forward = normal; source.gameObject.SetActive(true); source.pitch = pitch; source.PlayOneShot(clip); } }
public override void Fire() { if (CanFire() && _anim.CanReloadOrFire()) { var projectil = PoolSystem.GetInstance <ProjectilComponent>(_projectilPrefab); Vector3 startPosition = GetMuzzleEndPosition(_cameraController.GetMainCamera(), _cameraController.GetWeaponCamera()); projectil.Launcher(ExplositionVFX, startPosition, _muzzleEnd.rotation, _playerForward.forward, _throwForce, _damage); ClipAmmo--; base.Fire(); } //Start call update method enabled = true; }
/// <summary> /// /// </summary> /// <param name="prefab">Wheather passed how null, will put default death VFX</param> /// <param name="hitPosition">Position to place the vfx</param> /// <param name="normal">Normal that forward will point</param> public void SpawnDeathVFX(ParticleSystem prefab, Vector3 hitPosition, Vector3 normal) { var particle = PoolSystem.GetInstance <ParticleSystem>(prefab); SpawnVFX(particle, hitPosition, normal); }
public void SpawnExplositionVFX(Vector3 position, Vector3 rotation) { var particle = PoolSystem.GetInstance <ParticleSystem>(_explositionVFX); SpawnVFX(particle, position, rotation); }
public void SpawnImpactHitVFX(Vector3 hitPosition, Vector3 normal) { var particle = PoolSystem.GetInstance <ParticleSystem>(_hitPrefabVFX); SpawnVFX(particle, hitPosition, normal); }