initial upload
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
[Serializable]
|
||||
public class destoryaftertimer : MonoBehaviour
|
||||
{
|
||||
public float timeOut;
|
||||
|
||||
public bool detachChildren;
|
||||
|
||||
public destoryaftertimer()
|
||||
{
|
||||
timeOut = 1f;
|
||||
}
|
||||
|
||||
public virtual void Awake()
|
||||
{
|
||||
Invoke("DestroyNow", timeOut);
|
||||
}
|
||||
|
||||
public virtual void DestroyNow()
|
||||
{
|
||||
if (detachChildren)
|
||||
{
|
||||
transform.DetachChildren();
|
||||
}
|
||||
UnityEngine.Object.DestroyObject(gameObject);
|
||||
}
|
||||
|
||||
public virtual void Main()
|
||||
{
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user