using UnityEngine;

namespace ScrambleKit.Lifecycle
{
    public class DestroyTimer : MonoBehaviour
    {
        public float Lifetime;

        private float startTime;

        void Start()
        {
            startTime = Time.time;
        }

        void Update()
        {
            if (Time.time - startTime >= Lifetime)
                GameObject.Destroy(gameObject);
        }
    }

}