Witam. Spotkałem pewien błąd i zbytnio nie wiem jak go naprawić. Najlepiej pokaże kod:
public class GameLoader : MonoBehaviour
{
void Start()
{
SceneSelect SS = gameObject.GetComponent<SceneSelect>();
SS.Select("EdekGame"); //Tu występuje wyjątek
}
}
public class SceneSelect : MonoBehaviour
{
public void Select(string scene)
{
PlayerPrefs.SetString("BackScene", SceneManager.GetActiveScene().name);
PlayerPrefs.Save();
SceneManager.LoadScene(scene);
}
I wyjątek:
NullReferenceException: Object reference not set to an instance of an object
Nie wiem o co chodzi, tym bardziej, że taki sam kod działa w innych częściach programu.
Proszę o pomoc i z góry dziękuje :)