using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class OnTriggerLoadLevel : MonoBehaviour
{
public GameObject guiObject;
public string levelToLoad;
private void Start()
{
guiObject.SetActive(false);
}
private void OnTriggerStay(Collider other)
{
if (other.gameObject.tag == "soda")
{
guiObject.SetActive(true);
if (guiObject.activeInHeirarchy == true && Input.GetButtonDown("Use"))
{
Application.LoadLevel(levelToLoad);
}
}
}
private void OnTriggerExit()
{
guiObject.SetActive(false);
}
}