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

public class DontDestroyOnLoad : MonoBehaviour
{
	static DontDestroyOnLoad instance = null;

	void Awake()
	{
		if (instance != null && instance != this)
		{
			DestroyImmediate(gameObject);
		}
		else

		{
			instance = this;
			GameObject.DontDestroyOnLoad(gameObject);  // insures this object is not destroyed when loading a new scene
			
		}
	}

		// Update is called once per frame
		void Update()
    {
        
    }
}
