public void ChangeScene(Scene scene) { this.scene = scene; this.scene.SceneUpdated += currentScene_SceneUpdated; }
private async void connectButton_Click(object sender, EventArgs e) { try { if(client.IsConnected) { client.Disconnect(); scene?.Stop(); } else { debugLogTextBox.Clear(); scene = new Scene(); mapView.ChangeScene(scene); await client.ConnectAsync(connectHostTextBox.Text, (int)connectPortNumericUpDown.Value); } } catch(Exception ex) { WriteLog(LogType.ERROR, ex.Message); } }