예제 #1
0
    private void Start()
    {
        ui = FindObjectOfType <UI_ManagerBase>();
        GameManager gm = FindObjectOfType <GameManager>();

        lvl      = FindObjectOfType <LevelManager>();
        soundMng = GetComponent <SoundManager>();
        if (gm == null && lvl != null)
        {
            instance = this;
            ui.Setup(gm);
            soundMng.Init();
            lvl.Init(ui, speedrunMode);
            if (speedrunMode)
            {
                PlayerInputManager.SetCanReadInput(false);
                lvl.GetPlayer().GetHealthController().SetCanLoseHealth(false);

                ui.GetGameplayManager().GetCountdownPanel().OnCountdownEnd += HandleOnCountdownEnd;
                ui.ToggleMenu(MenuType.Countdown);
            }
            else
            {
                PlayerInputManager.SetCanReadInput(true);
                ui.ToggleMenu(MenuType.Game);
            }
        }
        else
        {
            DestroyImmediate(gameObject);
        }
    }
예제 #2
0
 public override void Setup(UI_ManagerBase _uiManager)
 {
     base.Setup(_uiManager);
     if (GameManager.Exist())
     {
         lbMgn = GameManager.instance.GetLeaderboard();
     }
 }
예제 #3
0
 public override void Setup(UI_ManagerBase _uiManager)
 {
     HandleOnEnemyBulletChanged(ObjectTypes.None);
     EnableHealthBar(true);
     EnableToleranceBar(false);
     activeBullet    = ObjectTypes.StunBullet;
     timerText.color = timerDefaultColor;
 }
예제 #4
0
    /// <summary>
    /// Funzione che cerca un ui manager in scena e se è diverso da quello precedente lo sostituisce
    /// </summary>
    public UI_ManagerBase FindUIManager()
    {
        UI_ManagerBase newUi = FindObjectOfType <UI_ManagerBase>();

        if (newUi != uiManager)
        {
            uiManager = newUi;
            uiManager.Setup(this);
        }

        return(uiManager);
    }
예제 #5
0
        public override void Enter()
        {
            levelManager = FindObjectOfType <LevelManager>();
            ui           = context.gameManager.GetUIManager();

            videoStream = levelManager.GetVideoStream();
            if (videoStream != null)
            {
                videoStream.OnVideoEnd += SetupStartGame;
                videoStream.PlayVideo();
            }
            else
            {
                SetupStartGame();
            }
        }
예제 #6
0
        public override void Enter()
        {
            UIMenu_LevelSelection.OnLevelSelected += HandleLevelSelected;

            if (SceneManager.GetActiveScene().name == "MainMenu")
            {
                uiManager = context.gameManager.FindUIManager();
                uiManager.ToggleMenu(MenuType.MainMenu);
                context.gameManager.GetSoundManager().PlayMainMenuMnusic();
            }
            else
            {
                context.gameManager.GetUIManager().ToggleMenu(MenuType.Loading);
                SceneManager.LoadScene("MainMenu");
                SceneManager.sceneLoaded += OnSceneLoaded;
            }
        }
예제 #7
0
        private void OnSceneLoaded(Scene _scene, LoadSceneMode _mode)
        {
            uiManager = context.gameManager.FindUIManager();
            LevelManager levelManager = FindObjectOfType <LevelManager>();

            levelManager.Init(uiManager, context.gameManager.GetLevelsManager().GetMode());
            videoStream = levelManager.GetVideoStream();
            if (videoStream != null)
            {
                videoStream.OnVideoLoad += HandleVideoLoaded;
                videoStream.LoadVideo();
            }
            else
            {
                uiManager.ToggleMenu(MenuType.None);
                context.OnLevelSetupCallback();
            }
        }
예제 #8
0
        public override void Setup(UI_ManagerBase _uiManager)
        {
            base.Setup(_uiManager);
            if (!GameManager.Exist())
            {
                return;
            }

            optionsMng = GameManager.instance.GetOptionsManager();

            if (resolutionDropdown != null)
            {
                LoadResolutions(optionsMng.GetResolutions());
            }

            if (qualityDropdown != null)
            {
                LoadQuality(optionsMng.GetQuality());
            }
        }
예제 #9
0
 public virtual void Setup(UI_ManagerBase _uiManager)
 {
     uiManager = _uiManager;
 }
예제 #10
0
 private void OnSceneLoaded(Scene _scene, LoadSceneMode _mode)
 {
     uiManager = context.gameManager.FindUIManager();
     uiManager.ToggleMenu(MenuType.MainMenu);
     context.gameManager.GetSoundManager().PlayMainMenuMnusic();
 }
예제 #11
0
    /// <summary>
    /// Inizializzazione elementi del livello (verrà chiamata dalla SM)
    /// </summary>
    public void Init(UI_ManagerBase _uiManager, bool _speedrunMode)
    {
        instance  = this;
        pause     = false;
        uiManager = _uiManager.GetGameplayManager();

        //Init
        poolMng = GetComponent <PoolManager>();
        if (poolMng != null)
        {
            poolMng.Init();
        }

        stickyMng = GetComponent <StickyObjectManager>();
        if (stickyMng != null)
        {
            stickyMng.Init();
        }

        enemyMng = GetComponent <EnemyManager>();
        if (enemyMng != null)
        {
            enemyMng.Init();
        }

        platformMng = GetComponent <PlatformManager>();
        if (platformMng != null)
        {
            platformMng.Init(uiManager.GetGameplayManager());
        }

        speedMng = GetComponent <SpeedrunManager>();
        if (speedMng != null)
        {
            speedMng.Init(_speedrunMode);
        }

        checkpointMng = GetComponent <CheckpointManager>();
        if (checkpointMng != null)
        {
            checkpointMng.Init(speedMng);
        }

        poopCtrl = FindObjectOfType <PoopController>();
        if (poopCtrl != null)
        {
            poopCtrl.Init();
        }

        tokenMng = GetComponent <TokenManager>();
        if (tokenMng != null)
        {
            tokenMng.Init(speedMng);
        }

        player = FindObjectOfType <Player>();
        if (player != null)
        {
            player.Init(enemyMng, platformMng, tokenMng);
        }

        tutorialMng = GetComponent <TutorialManager>();
        if (tutorialMng != null)
        {
            tutorialMng.Init(enemyMng, player);
        }

        cameraMng = GetComponent <CameraManager>();
        if (cameraMng != null)
        {
            cameraMng.Init();
        }

        doorsMng = GetComponent <DoorsButtonsManager>();
        if (doorsMng != null)
        {
            doorsMng.Init();
        }

        videoStream = FindObjectOfType <StreamVideo>();

        //Setup
        enemyMng.EnemiesSetup();

        //Iscrizione Eventi
        PlayerInputManager.OnPausePressed += HandlePlayerPauseButtonPressed;
        player.OnPlayerDeath += HandlePlayerDeath;
        OnGamePause          += GamePause;
        OnGameUnPause        += GameUnPause;
    }
예제 #12
0
 /// <summary>
 /// Setup del menu
 /// </summary>
 public void Setup(UI_ManagerBase _manager)
 {
     manager  = _manager;
     isActive = true;
     OnSetup();
 }
예제 #13
0
 public override void Setup(UI_ManagerBase _uiManager)
 {
     base.Setup(_uiManager);
     countdownText.SetText("");
 }
예제 #14
0
        public override void Setup(UI_ManagerBase _uiManager)
        {
            base.Setup(_uiManager);

            PlayerLivesController.OnLivesChange += HandleLivesChange;
        }