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

public class LevelManager : MonoBehaviour
{
    
    public bool spikeHit;
    public RawImage resetScreenRawImage;
    public bool freezeGame;
    public bool fellIntoVoid;

    // Update is called once per frame
    void Update()
    {
        if (Input.GetKey(KeyCode.F6)) // quickload button
        {
            spikeHit = false;
            fellIntoVoid = false;
            freezeGame = false;
        }

        if (fellIntoVoid)
        {
            freezeGame = true;
        }


        if (spikeHit)
        {
            freezeGame = true;
        }

        if (freezeGame)
        {
            resetScreenRawImage.enabled = true;
            Time.timeScale = 0.0f;
        }
        else
        {
            resetScreenRawImage.enabled = false;
            Time.timeScale = 1.0f;
        }
    }
}
