async void OnSpawn(object sender, EventArgs e) { surface.Stop(); if (surface.Parent is ViewGroup) { ((ViewGroup)surface.Parent).RemoveView(surface); } StartActivity(typeof(MainActivity)); }
void OnRestartGameClicked(object sender, EventArgs e) { launched = false; if (surface != null) { surface.Stop(); var viewGroup = surface.Parent as ViewGroup; viewGroup?.RemoveView(surface); } LaunchUrho(); }