I always have problem with this function.
Anyway i am trying to load a level when you click on button.
So heres my code
public void loadlevel(string lvlname)
{
StartCoroutine (displayloadingscreen (string lvlname));
}
IEnumerator displayloadingscreen(string lvlname)
{
AsyncOperation async = Application.LoadLevelAsync (lvlname);
while (!async.isDone) {
bar.GetComponent<loadingbar> ().progress=async.progress;
yield return null;
}
}
I am getting Unexpected symbol ‘lvlname’, expecting’.’ error