private void Load(Configuration conf, Pacmac player) { _conf = conf; _player = player; SetUI(conf); }
private void GoToMenu() { var manager = GameObject.FindWithTag("GameManager"); Pacmac player = Unload(); manager.GetComponent <GameManager>().GoToMenu(player); }
public void EatPellet(Pacmac pacmac, Pellet pellet) { pacmac.SetPelletEatenCount(pacmac.GetPelletEatenCount() + 1); SetState(pellet); int added = pellet.GetEaten(); AddScore(pacmac, +added); }
public void Update(Pacmac pacmac) { if (_type != PacmacStateType.NORMAL) { float elapsed = Time.time - _stateStartTime; if (elapsed > pacmac.GetPowerTime()) { Reset(); } } }
public void GoToMenu(Pacmac player) { ClearActive(); var sceneMenu = SceneManager.GetSceneByName("Menu"); SceneManager.SetActiveScene(sceneMenu); SceneManager.MoveGameObjectToScene(_menuWrapper, sceneMenu); _menuManager.SetActive(true); _menuWrapper.SetActive(true); _menuManager.GetComponent <MenuManager>().PausePlay(_conf, player); }
public void GoToLevel(Pacmac player) { ClearActive(); // SceneManager.LoadScene(1, LoadSceneMode.Additive); // SceneManager.UnloadSceneAsync(2); var sceneLevel = SceneManager.GetSceneByName("Level"); SceneManager.SetActiveScene(sceneLevel); SceneManager.MoveGameObjectToScene(_levelWrapper, sceneLevel); _levelManager.SetActive(true); _levelWrapper.SetActive(true); _levelManager.GetComponent <LevelManager>().StartLevel(_conf, player); }
public void GoToGameOver(Pacmac player) { ClearActive(); // SceneManager.UnloadSceneAsync(1); // SceneManager.LoadScene(2, LoadSceneMode.Additive); var sceneGameOver = SceneManager.GetSceneByName("GameOver"); SceneManager.SetActiveScene(sceneGameOver); SceneManager.MoveGameObjectToScene(_gameOverWrapper, sceneGameOver); _gameOverManager.SetActive(true); _gameOverWrapper.SetActive(true); _gameOverManager.GetComponent <GameOverManager>().EndPlay(_conf, player); }
public void FightGhost(Pacmac pacmac, Ghost ghost) { switch (_type) { case PacmacStateType.POWER: EatGhost(pacmac, ghost); break; case PacmacStateType.NORMAL: case PacmacStateType.SUPER: default: GetPowerOwned(pacmac, ghost); break; } }
private void AddScore(Pacmac pacmac, int addedBase) { int added = addedBase; switch (_type) { case PacmacStateType.SUPER: added *= 2; break; case PacmacStateType.NORMAL: case PacmacStateType.POWER: default: break; } pacmac.SetScore(added + pacmac.GetScore()); }
public float GetSpeed(Pacmac pacmac) { float speed = pacmac.GetSpeedBase(); switch (_type) { case PacmacStateType.SUPER: speed *= 2; break; case PacmacStateType.NORMAL: case PacmacStateType.POWER: default: break; } return(speed); }
public void StartLevel(Configuration conf, Pacmac player) { Load(conf, player); ResetLevel(0); }
private void Load(Configuration conf, Pacmac player) { Load(conf); _pacmac.GetComponent <PacmacBehaviour>().SetPacmac(player); }
private void EatGhost(Pacmac pacmac, Ghost ghost) { int added = ghost.GetEaten(); pacmac.SetScore(pacmac.GetScore() + added); }
public void SetPacmac(Pacmac character) { _char = character; _char.Set(_speedBase, _powerTime); }
private void UnpausePlay(Configuration conf, Pacmac player) { conf = Unload(conf); GameObject.FindWithTag("GameManager").GetComponent <GameManager>().GoToLevel(conf, player); }
public void EndPlay(Configuration conf, Pacmac player) { Load(conf); SetUI(); }
public void PausePlay(Configuration conf, Pacmac player) { Load(conf, player); }
private void GetPowerOwned(Pacmac pacmac, Ghost ghost) { /* he ded */ SetType(PacmacStateType.DED); }
public void GoToLevel(Configuration conf, Pacmac player) { _conf = conf; GoToLevel(player); }