private void LoadButton_OnClicked(Button button) { var popup = new PopupTextfield(CurrentLevelName); Menu.Instance.OpenPopup(popup); popup.OnDone += (sender, text) => { LevelUtil.LoadWorld(text); CurrentLevelName = text; }; }
/// <summary> /// Switches to the Editor scene. If level is specified that level will be loaded. /// </summary> /// <param name="level">Level to load, null if new level</param> public static void SwitchScene(string level) { Application.NewScene(); if (level != null) { LevelUtil.LoadWorld(level); } var editor = GameObject.Create <EditorScene>("EditorScene"); if (level != null) { editor.CurrentLevelName = level; } }
public static void SwitchScene(string level) { Application.NewScene(); LevelUtil.LoadWorld(level); GameObject.Create <PlayScene>("PlayScene"); }