using System.Collections;
using System.Collections.Generic;
using UnityEngine;

/*! \class AutoDisable
 *  \brief Automatically disable objects.
 */
public class AutoDisable : MonoBehaviour
{
    [SerializeField]private float activeDuration;                       //!< Time that this object will be activated.

    // Use this for initialization
    void OnEnable()
    {
        Invoke("Destroy", activeDuration);
    }

    /// Turns the object off.
    private void Destroy()
    {
        gameObject.SetActive(false);
    }
}
