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

public class StopApplicationFromConfig : MonoBehaviour
{
    public ConfigReader Config;
    private float totaltime;
    private float currenttime = 0f;
    void Start()
    {
        totaltime = Config.configuration.SimulationTime;
    }

    private void Update()
    {
        currenttime += Time.deltaTime;
        if (currenttime > totaltime)
        {
            // stop the application (does not work in the Editor, only for builds)
            Application.Quit();
        }
    }
}
