Hi,
If I drag the LevelManager script into the OnClick section of the button, and then search for functions, there is no LevelManager option to choose from. I did change the function to public.
Any idea why?
LevelManager Script
using UnityEngine;
using System.Collections;
using UnityEngine.SceneManagement;
public class LevelManager : MonoBehaviour {
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
if (Input.GetKeyDown("space"))
{
LoadNextScene();
}
}
public void LoadNextScene() {
int currentIndex = SceneManager.GetActiveScene().buildIndex;
//Load currentIndexIndex + 1
SceneManager.LoadScene(currentIndex + 1);
}
}
Inspector