using Ktyl.Util; using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.InputSystem; using UnityEngine.UI; public class PickUpDisplay : MonoBehaviour { public bool paused => _paused; [SerializeField] private static bool _paused; [SerializeField] private GameObject artefactUI; [SerializeField] private SerialInt nearbyArtefactID; [SerializeField] private GameObject Player; [SerializeField] private Text artefactText; [SerializeField] private GameObject Artefacts; private Artefact chosenArtefact; private static List completeList = new List(); private void Awake() { EventHandler.current.onArtefactUI += PopUpOn; int i; for(i=0; i().data); } } private void FixedUpdate() { foreach(Artefact arte in completeList) { if (nearbyArtefactID != -1 && arte.artefactID == nearbyArtefactID) chosenArtefact = arte; } } public void PopUpOn() { _paused = true; artefactUI.SetActive(true); Player.GetComponent().enabled = false; artefactText.text = "You have unlocked " + chosenArtefact.Name + "!"; //Time.timeScale = 0f; } public void PopUpOff() { _paused = false; artefactUI.SetActive(false); Player.GetComponent().enabled = true; //Time.timeScale = 1.0f; } }