public void ResumeGame() { CoreConnector.UIManager.ShowGamePlayUI(); CoreConnector.GameUIManager.DisplayInGameButtons(true); levelTimer.StartTimer(); touchPosition.ResumeGame(); gameState = lastGameState; Time.timeScale = 1.0f; }
public void StartLevel() { bool allowStart = true; foreach (InventoryItem item in inventoryItems) { if (item.itemCount != 0) { allowStart = false; } } if (allowStart) { Hero hero = GameObject.FindGameObjectWithTag("Hero").GetComponent <Hero>(); if (hero == null) { Debug.Log("ERROR: no hero!"); } hero.StartMoving(); timer.StartTimer(); } else { DisplayMessage("Place all the items first!"); } }
private IEnumerator SpawnPlayer() { player.transform.localScale = Vector3.zero; while (player.transform.localScale.x < 1f) { player.transform.Rotate(-Vector3.forward * 360f * Time.deltaTime); player.transform.localScale += Vector3.one * 2f * Time.deltaTime; yield return(null); } player.Reset(); yield return(new WaitForSeconds(0.2f)); player.Enable(); timer.ResetTimer(); timer.StartTimer(); rotation.canRotate = true; foreach (var s in shrinkingTiles) { s.StartShrinking(); } }
// Call this in a fail state to reset the player. // Eventually this needs to involve some sort of timed delay, // so the you don't just restart immediately public void Died() { LevelTimer timer = GetComponent <LevelTimer>(); FindAssets(); Player.transform.position = getSpawnLocation(); timer.Reset(); timer.StartTimer(); }
/* * Desc: Starts the level -- Starts level timer and starts spawning gophers */ public void StartLevel() { // Set gameplay screen, disable pre-gameplay screen screenPreGameplay.SetActive(false); screenEnd.SetActive(false); screenGamePlay.SetActive(true); // Activate gameplay cursor gameplayCursor.SetActive(true); // WAS PREVIOUSLY IN START() InstantiateLevelObjects(); LoadLevelSettings(); LevelTimer.TimerFinished += EndLevel; _levelTimer.StartTimer(); StartSpawningGophers(); }
private void StartLevel() { StartSpawner(); levelStarted = true; timer.StartTimer(); }
public void StartNewTimer() { timer.StartTimer(); }