private void onEditButtonClicked(string name) { var dialog = new UIConfirmDialog(gameSystem, "confirm", "edit game world?"); dialog.okButtonClicked = () => { dialog.Close(); uiEditGameWorldDialog.Close(); gameSystem.sceneToWaiting(); Task.Run(async() => { try { var gw = await GameWorldHelper.loadGameWorldData <GameWorldSystem>(name); gw.camera = new Camera(gameSystem.option.screenWidth, gameSystem.option.screenHeight); gameSystem.dispatchSceneToEditGame(gw); } catch (Exception e) { Debug.WriteLine(e); throw; } }); }; dialog.ShowDialog(formMain); }
public async Task load(string gameWorldFileName, string gameScenarioFile) { var gameWorld = await GameWorldHelper.loadGameWorldData <GameWorld>(gameWorldFileName); }