Код: Выделить всё
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
public class loadlevels : MonoBehaviour {
public Button b2;
public Button b3;
void OnLevelWasLoaded() {
int MyLevel = PlayerPrefs.GetInt("Level");
switch (MyLevel) {
case 2:
b2.interactable = true;
b2.image.sprite = Resources.Load ("UISprite");
break;
case 3:
b3.interactable = true;
b3.image.sprite = Resources.Load("UISprite");
break;
}
}
}
Подробнее здесь: https://stackoverflow.com/questions/297 ... sing-unity