private Flow CreateFlow(GV.SCENENAMES _flow) { Flow flow; switch (_flow) { case GV.SCENENAMES.StartScene: flow = new StartSceneFlow(); break; case GV.SCENENAMES.MainMenu: flow = new MainMenuFlow(); break; case GV.SCENENAMES.GameScene: flow = new GameFlow(); break; default: flow = null; break; } if (flow != null) { SceneManager.Instance.LoadScene(_flow.ToString(), SceneLoaded); } return(flow); }
private void BootGame() { //Setting up controllers, databases, flow-stack etc. //Core functionality var viewDatabase = databaseHelper.Get <ViewDatabase>(); var viewController = new ViewController(viewDatabase); var flowStack = new FlowStack(); //Game, map, battle var tankDatabase = databaseHelper.Get <TankDatabase>(); var crewDatabase = databaseHelper.Get <CrewDatabase>(); var cardsDatabase = databaseHelper.Get <CardsDatabase>(); var activeCardsPanelLifecycleHandler = new ActiveCardsPanelLifecycleHandler(viewController); var abilitiesPanelLifecycleHandler = new AbilitiesPanelLifecycleHandler(tankDatabase); var tankPanelLifecycleHandler = new TankPanelLifecycleHandler(); var dragAndDropArrow = new DragAndDropArrowController(viewController); var battleHUD = new BattleHUD(viewController, activeCardsPanelLifecycleHandler, abilitiesPanelLifecycleHandler, tankPanelLifecycleHandler, dragAndDropArrow); var gameControllerFactory = new GameControllerFactory(flowStack, viewController, battleHUD, tankDatabase, crewDatabase, cardsDatabase); //Main menu var mainMenuControllerFactory = new MainMenuControllerFactory(flowStack, viewController, gameControllerFactory); //Start Flow var menuFlow = new MainMenuFlow(mainMenuControllerFactory); flowStack.Push(menuFlow); }
private Flow InitializeFlowScript(CurrentState flowType, int progressPoint, bool sceneAlreadyLoaded) { Flow newFlow; switch (flowType) { case CurrentState.MainMenu: newFlow = new MainMenuFlow(); break; case CurrentState.Game: newFlow = new GameFlow(); break; case CurrentState.Tutorial: newFlow = new TutorialFlow(); break; default: return(null); } if (!sceneAlreadyLoaded) { SceneManager.sceneLoaded -= OnSceneLoaded; //Clean any listener already on SceneManager.sceneLoaded += OnSceneLoaded; //Delay flow initialization until } else { newFlow.Initialize(progressPoint); } return(newFlow); }
private Flow CreateFlow(SceneNames _flowToLoad) { Flow toRet; switch (_flowToLoad) { case SceneNames.MainMenu: toRet = new MainMenuFlow(); break; case SceneNames.MainScene: toRet = new GameFlow(); break; default: toRet = new GameFlow(); Debug.LogError("Unhandled Switch: " + _flowToLoad.ToString()); break; } return(toRet); }
private Flow CreateFlow(SceneNames flowToLoad) { Flow toRet = null; //Check the name of the scene to create the new flow switch (flowToLoad) { case SceneNames.MainMenu: toRet = new MainMenuFlow(); break; case SceneNames.Game: toRet = new GameFlow(); break; default: Debug.Log("Unhandled switch " + flowToLoad); break; } return(toRet); }
private Flow CreateFlow(GV.SCENENAMES _flow) { Flow flow; switch (_flow) { case GV.SCENENAMES.MainEntryScene: flow = new MainEntryFlow(); break; case GV.SCENENAMES.MainMenu: flow = new MainMenuFlow(); break; case GV.SCENENAMES.MainScene: flow = new MainSceneFlow(); break; case GV.SCENENAMES.BattleScene: flow = new BattleFlow(); break; case GV.SCENENAMES.MacroScene: flow = new MacroSceneFlow(); break; default: flow = new MainSceneFlow(); break; } if (_flow != GV.SCENENAMES.MainEntryScene) { SceneManager.Instance.LoadScene(_flow.ToString(), SceneLoaded); } return(flow); }