added main menu
This commit is contained in:
@@ -11,6 +11,7 @@ namespace Darkmatter.Presentation
|
||||
[Header("VFX")]
|
||||
public ParticleSystem MuzzleFlashParticle;
|
||||
public ParticleSystem BulletHitEffectParticle;
|
||||
public ParticleSystem ZombieHitEffectParticle;
|
||||
|
||||
[Header("Weapon Data")]
|
||||
public float fireRate = 0.1f;
|
||||
@@ -44,17 +45,24 @@ namespace Darkmatter.Presentation
|
||||
{
|
||||
var damageable = hitPoint.transform.GetComponent<IDamageable>();
|
||||
Debug.Log(hitPoint.transform);
|
||||
|
||||
Vector3 particleSpawnPos = hitPoint.point + hitPoint.normal * 0.01f;
|
||||
Quaternion ParticleRotation = Quaternion.LookRotation(hitPoint.normal);
|
||||
|
||||
if (damageable != null)
|
||||
{
|
||||
ZombieHitEffectParticle.transform.position = particleSpawnPos;
|
||||
ZombieHitEffectParticle.transform.rotation = ParticleRotation;
|
||||
ZombieHitEffectParticle.Play(true);
|
||||
damageable.TakeDamage(10f);
|
||||
}
|
||||
|
||||
Vector3 spawnPos = hitPoint.point + hitPoint.normal * 0.01f;
|
||||
|
||||
BulletHitEffectParticle.transform.position = spawnPos;
|
||||
BulletHitEffectParticle.transform.rotation = Quaternion.LookRotation(hitPoint.normal);
|
||||
|
||||
BulletHitEffectParticle.Play(true);
|
||||
else
|
||||
{
|
||||
BulletHitEffectParticle.transform.position = particleSpawnPos;
|
||||
BulletHitEffectParticle.transform.rotation = Quaternion.LookRotation(hitPoint.normal);
|
||||
BulletHitEffectParticle.Play(true);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void Reload()
|
||||
|
||||
Reference in New Issue
Block a user