A lot of stuff to Commit because I forgot to Commit in between (Don't do stuff like this, kids)
This commit is contained in:
@@ -49,7 +49,11 @@ public class SceneSwitcherEditorWindow : EditorWindow
|
||||
Button button = new Button();
|
||||
button.text = scene.name;
|
||||
int sceneIndex = scene.index; // Capture the index in a local variable
|
||||
button.clicked += () => SceneSwitcher.Instance.SwitchScene(sceneIndex);
|
||||
button.clicked += () =>
|
||||
{
|
||||
SceneSwitcher.Instance.SwitchScene(sceneIndex);
|
||||
Selection.activeGameObject = SceneSwitcher.Instance.GetGameObject(sceneIndex);
|
||||
};
|
||||
scrollView.Add(button);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user