private void Start() { StartCoroutine(CheckPlayerDistance()); if (UI_PickItem.activeInHierarchy) { UI_PickItem.SetActive(false); } }
private void Update() { if (distanceFromPlayer < 0.6f && LevelUP.statusReference == null) { UI_PickItem.SetActive(true); isPlayerNearby = true; if (Input.GetButtonDown("Circle")) { PlayerControl.PotionManager.PickUpPotion(gameObject); isPlayerNearby = false; } } else { isPlayerNearby = false; UI_PickItem.SetActive(false); } }