UPF/Assets/Game/Scripts/XpPass.cs
2022-08-29 02:19:41 +05:30

31 lines
607 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using TMPro;
using UnityEngine.UI;
public class XpPass : MonoBehaviour
{
public TMP_Text nextLevelTxt;
public Slider levelSlider;
public int maxLevels;
void Start()
{
Refresh();
}
public void Show(){
Refresh();
gameObject.SetActive(true);
}
public void Hide(){
gameObject.SetActive(false);
}
void Refresh(){
nextLevelTxt.text = (DBmanager.LevelInt +1).ToString();
levelSlider.value = DBmanager.Level / (float)maxLevels;
}
}