Scriptum/Assets/LevelUpPopUp.cs

28 lines
569 B
C#
Raw Normal View History

2022-10-23 15:56:31 +02:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class LevelUpPopUp : MonoBehaviour
{
public int lvlup;
public GameObject lvlUpPopUpPanel;
void Update()
{
lvlup = PlayerPrefs.GetInt("LvlUpPopUp");
if (lvlup == 1)
{
StartCoroutine(LvlUpTimer());
}
}
IEnumerator LvlUpTimer()
{
lvlUpPopUpPanel.SetActive(true);
PlayerPrefs.SetInt("LvlUpPopUp", 0);
yield return new WaitForSeconds(5);
lvlUpPopUpPanel.SetActive(false);
}
}