21 lines
468 B
C#
Executable File
21 lines
468 B
C#
Executable File
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class DeathEffect : MonoBehaviour
|
|
{
|
|
ParticleSystem[] particles;
|
|
AudioSource audioSrc;
|
|
void Awake(){
|
|
particles = GetComponentsInChildren<ParticleSystem>();
|
|
audioSrc = GetComponent<AudioSource>();
|
|
}
|
|
public void Play(){
|
|
audioSrc.Play();
|
|
|
|
foreach(ParticleSystem particle in particles){
|
|
particle.Play();
|
|
}
|
|
}
|
|
}
|