PBG2H23ABR_PBG2H23AKL_PMC_P.../Plunderblock/Assets/Scripts/ScriptsKevin/ParticleClash.cs
2024-07-03 12:46:41 +02:00

29 lines
554 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ParticleClash : MonoBehaviour
{
public float lifeTime = 2;
private float time = 0;
private void die(float time, float lifeTime){
if(time > lifeTime){
GameObject.Destroy(this.gameObject);
}
}
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
time += Time.deltaTime;
die(time, lifeTime);
}
}