private void BackButton_DidFinish() { foreach (KeyValuePair <MockCounterGroup, ConfigModel> kvp in MockCounter.loadedMockCounters) { Destroy(kvp.Key.CounterName); Destroy(kvp.Key.CounterData); } CountersPlusEditViewController.ClearScreen(); MockCounter.loadedMockCounters.Clear(); CounterWarning.ClearAllWarnings(); Destroy(TextHelper.CounterCanvas.gameObject); TextHelper.CounterCanvas = null; MainScreen.transform.position = MainScreenPosition; MainFlowCoordinator mainFlow = Resources.FindObjectsOfTypeAll <MainFlowCoordinator>().First(); mainFlow.InvokeMethod("DismissFlowCoordinator", this, null, false); foreach (CounterWarning warning in CounterWarning.existing) { DestroyImmediate(warning.gameObject); } }
protected override void BackButtonWasPressed(ViewController controller) { foreach (KeyValuePair <MockCounterGroup, ConfigModel> kvp in MockCounter.loadedMockCounters) { Destroy(kvp.Key.CounterName); Destroy(kvp.Key.CounterData); } CountersPlusEditViewController.ClearScreen(); MockCounter.loadedMockCounters.Clear(); CounterWarning.ClearAllWarnings(); Destroy(TextHelper.CounterCanvas.gameObject); TextHelper.CounterCanvas = null; MainScreen.transform.position = MainScreenPosition; MainFlowCoordinator mainFlow = Resources.FindObjectsOfTypeAll <MainFlowCoordinator>().First(); mainFlow.InvokePrivateMethod("DismissFlowCoordinator", new object[] { this, null, false }); ConfigModelController.ClearAllControllers(); //Reload settings from config CountersController.settings = ConfigLoader.LoadSettings(); }