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); } }
public override void Setup(UI_ManagerBase _uiManager) { base.Setup(_uiManager); if (GameManager.Exist()) { lbMgn = GameManager.instance.GetLeaderboard(); } }
public override void Setup(UI_ManagerBase _uiManager) { HandleOnEnemyBulletChanged(ObjectTypes.None); EnableHealthBar(true); EnableToleranceBar(false); activeBullet = ObjectTypes.StunBullet; timerText.color = timerDefaultColor; }
/// <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); }
public override void Enter() { levelManager = FindObjectOfType <LevelManager>(); ui = context.gameManager.GetUIManager(); videoStream = levelManager.GetVideoStream(); if (videoStream != null) { videoStream.OnVideoEnd += SetupStartGame; videoStream.PlayVideo(); } else { SetupStartGame(); } }
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; } }
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(); } }
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()); } }
public virtual void Setup(UI_ManagerBase _uiManager) { uiManager = _uiManager; }
private void OnSceneLoaded(Scene _scene, LoadSceneMode _mode) { uiManager = context.gameManager.FindUIManager(); uiManager.ToggleMenu(MenuType.MainMenu); context.gameManager.GetSoundManager().PlayMainMenuMnusic(); }
/// <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; }
/// <summary> /// Setup del menu /// </summary> public void Setup(UI_ManagerBase _manager) { manager = _manager; isActive = true; OnSetup(); }
public override void Setup(UI_ManagerBase _uiManager) { base.Setup(_uiManager); countdownText.SetText(""); }
public override void Setup(UI_ManagerBase _uiManager) { base.Setup(_uiManager); PlayerLivesController.OnLivesChange += HandleLivesChange; }