Scriptum/Assets/LevelUpPopUp.cs

34 lines
762 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class LevelUpPopUp : MonoBehaviour
{
public int lvlup;
public GameObject lvlUpPopUpPanel;
public GameObject border;
public GameObject border1;
void Update()
{
lvlup = PlayerPrefs.GetInt("LvlUpPopUp");
if (lvlup == 1)
{
StartCoroutine(LvlUpTimer());
}
}
IEnumerator LvlUpTimer()
{
lvlUpPopUpPanel.SetActive(true);
border.SetActive(true);
border1.SetActive(true);
PlayerPrefs.SetInt("LvlUpPopUp", 0);
yield return new WaitForSeconds(5);
lvlUpPopUpPanel.SetActive(false);
border.SetActive(false);
border1.SetActive(false);
}
}