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

public class StatusBarUIManager : MonoBehaviour
{
    public Text sceneNameText;
    public Button homeButton;
    public StatusBarUIManager instance;
    void Awake()
    {

        if (instance == null)
        {
            instance = this;
            DontDestroyOnLoad(this);
        }
        else
        {
            Object.DestroyImmediate(this);
        }
    }
    // Start is called before the first frame update
    void Start()
    {
        DontDestroyOnLoad(this);
    }

    // Update is called once per frame
    void Update()
    {
        sceneNameText.text = SceneManager.GetActiveScene().name;
        homeButton.enabled = !SceneManager.GetActiveScene().name.Equals("IntroScene");
    }

    public void MoveScene(string sceneName)
    {
        SceneManager.LoadScene(sceneName);
    }
}
