Ejemplo n.º 1
0
    public HowToPlayView CreateConcreteHowToPlayView()
    {
        HowToPlayView howToPlayView = Instantiate(_howToPlayView);

        container.Inject(howToPlayView);
        return(howToPlayView);
    }
Ejemplo n.º 2
0
    public void SwitchView()
    {
        switch (_menuScreensService.MenuStates)
        {
        case MenuScreensService.MenuScreens.Login:
            LoginView loginView = _menuFactory.CreateConcreteLoginView();
            loginView.transform.SetParent(gameObject.transform);
            loginView.OnLoginViewSetDel = SetState;                                                                             // nie korzysta z DelegateService, jego delegat jest nieco inny od pozostałych
            break;

        case MenuScreensService.MenuScreens.MainMenu:
            MainLobbyView mainLobbyView = _menuFactory.CreateConcreteMainLobbyView();
            mainLobbyView.transform.SetParent(gameObject.transform);
            _delegateService.OnStateSetDel = SetState;
            break;

        case MenuScreensService.MenuScreens.HowtoPlay:
            HowToPlayView howToPlay = _menuFactory.CreateConcreteHowToPlayView();
            howToPlay.transform.SetParent(gameObject.transform);
            _delegateService.OnStateSetDel = SetState;
            break;

        case MenuScreensService.MenuScreens.Credits:
            CreditsView creditsView = _menuFactory.CreateConcreteCreditsView();
            creditsView.transform.SetParent(gameObject.transform);
            _delegateService.OnStateSetDel = SetState;
            break;

        case MenuScreensService.MenuScreens.Achievements:
            AchievementsView achievementsView = _menuFactory.CreateConcreteAchievementsView();
            achievementsView.transform.SetParent(gameObject.transform);
            _delegateService.OnStateSetDel = SetState;
            break;

        case MenuScreensService.MenuScreens.Profile:
            ProfileView profileView = _menuFactory.CreateConcreteProfileView();
            profileView.transform.SetParent(gameObject.transform);
            _delegateService.OnStateSetDel = SetState; break;

        case MenuScreensService.MenuScreens.NewGame:
            SceneManager.LoadScene("Game");
            break;
        }
    }