*
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
public class SelfDestroy : MonoBehaviour {
|
||||
private float startTime;
|
||||
public float Delay = 1;
|
||||
// Use this for initialization
|
||||
void Start () {
|
||||
startTime = Time.time;
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update () {
|
||||
if (Time.time >= startTime + Delay) {
|
||||
Destroy(gameObject);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user