private void Start() { currentGO = Instantiate(dummyPrefab) as GameObject; isGroundPlaced = false; isTombPlaced = false; gameManagerController = GameObject.FindWithTag("GameManager").GetComponent <GameManagerController>(); Level level = LevelGame.GetInstance().GetLevel(); float levelGame = level.GetDifficult(); if (levelGame == 0) { numOfTombsPlaced = 1; } else { numOfTombsPlaced = (int)levelGame * 2; } if (gameManagerController.isGameSetup == false) { if (!isGroundPlaced) { AllowPlaceGroundButton(); } } }
void RunGame() { Debug.Log(LevelGame.GetInstance().GetLevel().GetName()); ScoreManager.GetInstance().ResetScore(); IncreaseScore(0); isGameOver = false; timeLeft = playTime; player = GameObject.FindWithTag("MainCamera"); playerController = player.GetComponent <PlayerController>(); playerController.InitHp(playerHpMax); gun = GameObject.FindWithTag("Gun").GetComponent <GunController>(); UpdadtePlayerHP(); InvokeRepeating("UpdateTimeLeft", 0, 0.5f); }
// Update is called once per frame void Update() { if (!hasStartSpawn) { if (gameManagerController.isGamePlaying) { float i = 1; if (LevelGame.GetInstance().GetLevel().GetDifficult() != 0) { i = LevelGame.GetInstance().GetLevel().GetDifficult(); } InvokeRepeating("spawnZombie", 0, timeDelay / i); hasStartSpawn = true; } } }
void SetLevelChosen() { LevelGame.GetInstance().SetLevel(currentLevel); }