ARZombieShooter/Assets/Scripts/Shoot.cs
/// <summary>
/// Creates and destroys particle effect.
/// </summary>
/// <param name="effect">Effect to instantiate.</param>
/// <param name="destroyAfterDelay">Destroy particle effect after delay.</param>
/// <param name="hit">RaycastHit.</param>
Creates and destroys particle effect.
Creates and destroys particle effect .
void CreateAndDestroyParticleEffect(GameObject effect, float destroyAfterDelay, RaycastHit hit) {
		GameObject particleEffectGameObject = Instantiate (effect, hit.point, Quaternion.LookRotation (hit.normal)); 
		Destroy (particleEffectGameObject, destroyAfterDelay);
	}
void CreateAndDestroyParticleEffect ( GameObject effect , float destroyAfterDelay , RaycastHit hit ) { GameObject particleEffectGameObject = Instantiate ( effect , hit . point , Quaternion . LookRotation ( hit . normal ) ) ; Destroy ( particleEffectGameObject , destroyAfterDelay ) ; }
Creates and destroys particle effect.
Creates and destroys particle effect .
// Instantiate particle effetct. // Destroy blood effect after short time.
effect
GameObject
Effect to instantiate.
Effect to instantiate .
destroyAfterDelay
float
Destroy particle effect after delay.
Destroy particle effect after delay .
hit
RaycastHit
None