26 lines
465 B
C#
26 lines
465 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class missleTrail : MonoBehaviour
|
|
{
|
|
public float time;
|
|
private bool timer;
|
|
|
|
// Update is called once per frame
|
|
void Update()
|
|
{
|
|
if(timer)
|
|
time-=Time.deltaTime;
|
|
|
|
if (time < 0)
|
|
Destroy(gameObject);
|
|
}
|
|
|
|
public void StartTimer()
|
|
{
|
|
GetComponent<ParticleSystem>().Stop();
|
|
timer = true;
|
|
}
|
|
}
|