- Home /
Question by
tloarie · Jun 30, 2017 at 04:08 PM ·
scripting beginnernavigationdropdownoptions
Using a dropdown menu to navigate through scenes.
I am building a UI on unity and was hoping to use the dropdown menu as a way to navigate through the different pages that have been created as scenes.
Currently, I am in a situation where all 4 of my options lead you to the same SceneIndex, but I am looking for a way to set specific options to specific SceneIndexes. I know why my code is not working however, I cannot figure out how to fix it.
If anyone could help, it would be greatly appreciated!
Comment
How should we, you only said you know why your code doesn't work, but we don't.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Scene$$anonymous$$anagement;
public class Dropdown : $$anonymous$$onoBehaviour {
public void OnValueChange(int sceneIndex) {
Scene$$anonymous$$anager.LoadScene (sceneIndex);
}
}
^^ So the above code is taken from the same format as a button, but has been changed to OnValueChanged() ins$$anonymous$$d of LoadByIndex(). @hexagonius