2022-10-23 00:21:54 +02:00
|
|
|
using System.Collections;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using UnityEngine;
|
|
|
|
using UnityEngine.UI;
|
|
|
|
|
|
|
|
public class LevelBar : MonoBehaviour
|
|
|
|
{
|
|
|
|
public Slider slider;
|
2022-10-23 13:29:22 +02:00
|
|
|
public float maxExp;
|
|
|
|
public float exp;
|
2022-10-23 00:21:54 +02:00
|
|
|
|
|
|
|
public void SetStartExp(float exp)
|
|
|
|
{
|
2022-10-23 13:29:22 +02:00
|
|
|
maxExp = PlayerPrefs.GetFloat("maxExp");
|
|
|
|
slider.maxValue = maxExp;
|
2022-10-23 00:21:54 +02:00
|
|
|
//slider.value = exp;
|
|
|
|
}
|
|
|
|
|
2022-10-23 13:29:22 +02:00
|
|
|
void Update()
|
|
|
|
{
|
|
|
|
maxExp = PlayerPrefs.GetFloat("maxExp");
|
|
|
|
exp = PlayerPrefs.GetFloat("exp");
|
|
|
|
slider.maxValue = maxExp;
|
|
|
|
slider.value = exp;
|
|
|
|
//SetExp(exp);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* public void SetExp(float exp)
|
2022-10-23 00:21:54 +02:00
|
|
|
{
|
|
|
|
slider.value = exp;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* public void SetLevel()
|
|
|
|
{
|
|
|
|
|
|
|
|
}*/
|
|
|
|
}
|