22 lines
341 B
C#
22 lines
341 B
C#
using UnityEngine;
|
|
using System.Collections;
|
|
|
|
public class DestroySelf : MonoBehaviour {
|
|
|
|
public float timeout = 1.0f;
|
|
private float time = 0;
|
|
|
|
// Use this for initialization
|
|
void Start () {
|
|
|
|
}
|
|
|
|
// Update is called once per frame
|
|
void Update () {
|
|
time += Time.deltaTime;
|
|
if(time >= timeout){
|
|
Destroy(gameObject);
|
|
}
|
|
}
|
|
}
|