Does not work the download scenes, how to fix?

Not working code. Where the mistake was made? Problems writes, the colliders are 2D. By pressing nothing happens

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;

public class LoadScene : MonoBehaviour
{

public int N;

public void OnMouseDown ()
{

SceneManager.LoadScene(N);

}

}
April 19th 20 at 12:27
2 answers
April 19th 20 at 12:29
Solution
Did not work through the ui image, was also made, but through the usual and everything went
April 19th 20 at 12:31
Well, I am 100% sure that the docks had not read it, and why it is necessary, of course. File - Build Settings and there will add a scene in Unity
not, scenes are created and added long - Randal63 commented on April 19th 20 at 12:34
@Randal63, give name, zamesti numbers, maybe you're not so something recorded - Nelda56 commented on April 19th 20 at 12:37
@Nelda56, Tried using the numbers and text, there is no difference. Maybe the problem is that I have a UI image? - Randal63 commented on April 19th 20 at 12:40
@Randal63, Maybe you have a problem in that prior to the scene loading is not reached. - darrick.Volkman commented on April 19th 20 at 12:43
@beula.Volkman, this method is also triggered when clicked, I can't understand what the problem is - Randal63 commented on April 19th 20 at 12:46
@Randal63, why do you think so? I don't see there Debug.Log or something that would confirm it. - darrick.Volkman commented on April 19th 20 at 12:49
@beula.Volkman, now checked, probably not the method works, the type is not activated, what's the problem then maybe? - Randal63 commented on April 19th 20 at 12:52

Find more questions by tags Unity Game EngineC#