protected override void BackButtonWasPressed(ViewController topViewController)
        {
            Logger.log?.Info($"BackButtonWasPressed. topViewController is {topViewController?.name ?? "null"}");
            if (dismissFlow == null)
            {
                var dismissMethod = typeof(FlowCoordinator).GetMethod("DismissFlowCoordinator", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
                dismissFlow = (DismissFlowDel)Delegate.CreateDelegate(typeof(DismissFlowDel), dismissMethod);
            }
            MainFlowCoordinator mainFlow = Resources.FindObjectsOfTypeAll <MainFlowCoordinator>().First();

            dismissFlow(mainFlow, this, null, false);
        }
Ejemplo n.º 2
0
        private void backButton_DidFinish()
        {
            if (dismissFlow == null)
            {
                var ty = typeof(FlowCoordinator);
                var m  = ty.GetMethod("DismissFlowCoordinator", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
                dismissFlow = (DismissFlowDel)Delegate.CreateDelegate(typeof(DismissFlowDel), m);
            }

            MainFlowCoordinator mainFlow = Resources.FindObjectsOfTypeAll <MainFlowCoordinator>().First();

            dismissFlow(mainFlow, this, null, false);
        }
        private void backButton_DidFinish()
        {
            if (dismissFlow == null)
            {
                var ty = typeof(FlowCoordinator);
                var m  = ty.GetMethod("DismissFlowCoordinator", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
                dismissFlow = (DismissFlowDel)Delegate.CreateDelegate(typeof(DismissFlowDel), m);
            }

            if (exitActions.Count == 0)
            {
                MainFlowCoordinator mainFlow = Resources.FindObjectsOfTypeAll <MainFlowCoordinator>().First();
                dismissFlow(mainFlow, this, null, false);
            }
            else
            {
                var actions = exitActions;
                UnityAction <Scene, LoadSceneMode> releaseAction = null;
                releaseAction             = (a, b) => SceneManager_sceneLoaded(actions, releaseAction, a, b);
                SceneManager.sceneLoaded += releaseAction;
                Resources.FindObjectsOfTypeAll <MenuTransitionsHelperSO>().First().RestartGame(true);
            }
        }