Синтаксис:
Используется csharp
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class Save : MonoBehaviour
{
public Button[] lvls;
// Start is called before the first frame update
void Start()
{
if (PlayerPrefs.HasKey("Lvl"))
for (int i = 0; i < lvls.Length; i++)
{
if (i <= PlayerPrefs.GetInt("Lvl"))
lvls[i].interactable = true;
else
lvls[i].interactable = false;
}
}
}
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class Save : MonoBehaviour
{
public Button[] lvls;
// Start is called before the first frame update
void Start()
{
if (PlayerPrefs.HasKey("Lvl"))
for (int i = 0; i < lvls.Length; i++)
{
if (i <= PlayerPrefs.GetInt("Lvl"))
lvls[i].interactable = true;
else
lvls[i].interactable = false;
}
}
}