public void LevelClearCondition() { // Enable teleporters teleportersExit.GetComponent <TeleporterManager>().EnableTeleporters(); IsSublevelComplete = true; OnLevelComplete?.Invoke(this, EventArgs.Empty); }
private void onBoxMovement(Vector2Int pBoxStartPosition, Vector2Int pBoxTargetPosition) { if (_boxHolderDictionary.ContainsKey(pBoxStartPosition)) { if (_boxHolderDictionary[pBoxStartPosition] == true) { _capturedBoxesCount--; _boxHolderDictionary[pBoxStartPosition] = false; } } bool lIsBoxInPlace = false; if (_boxHolderDictionary.ContainsKey(pBoxTargetPosition)) { if (_boxHolderDictionary[pBoxTargetPosition] == false) { _capturedBoxesCount++; _boxHolderDictionary[pBoxTargetPosition] = true; _particleSystem.transform.position = new Vector3(pBoxTargetPosition.x + 0.5f, pBoxTargetPosition.y + 0.5f, 0f); _particleSystem.Play(); lIsBoxInPlace = true; } } if (_capturedBoxesCount == _boxHolderDictionary.Count) { AudioManager.Instance.Play("LevelFinished"); OnLevelComplete?.Invoke(); } else if (lIsBoxInPlace) { AudioManager.Instance.Play("BoxInPlace"); } }
public void LevelComplete() { currentLevel++; OnLevelComplete?.Invoke(); shouldStartNextLevel = true; timeToNextLevel = 2; }
//When the player enters the trigger, trigger what ever is tied to the onComplete event private void OnTriggerEnter2D(Collider2D collision) { if (collision.transform.tag == "Player") { collision.transform.SendMessage("stopGame"); onComplete.Invoke(); } }
private void OnTriggerEnter2D(Collider2D collision) { if (collision.CompareTag("Player")) { Destroy(gameObject); OnLevelComplete?.Invoke(); } }
public void CheckForLevelEnd() { if (PlayerShoot.enemiesTr.Count == 0) { OnLevelComplete?.Invoke(); LoadNextLevel loadLevelScript = FindObjectOfType(typeof(LoadNextLevel)) as LoadNextLevel; loadLevelScript.OpenNextLevel(); } }
public void AddCakesPacked() { cakesPacked++; if (cakesPacked == 3) { Debug.Log("@@@@@@@@@ Truck is now packed @@@@@@@@@"); OnLevelComplete?.Invoke(this, EventArgs.Empty); } }
private void CompleteLevel() { Debug.Log("Level has been completed."); OnLevelComplete?.Invoke(LevelCompleteEventArgs); if (currentLevel.ID >= GameManager.Instance.HighestLevel) { GameManager.Instance.HighestLevel++; } }
private void OnTriggerEnter(Collider other) { if (!(other.gameObject.name == "Ball")) { return; } OnLevelComplete?.Invoke(); //TODO: SPAWN STARS //TODO: MOVE CAMERA }
private void OnPlayerEnter(Collider collider) { if (isBossTeleporter) { OnLevelComplete?.Invoke(this, EventArgs.Empty); } if (destination != null) { // Teleport player collider.GetComponent <PlayerSystem>().SetLevel(destination); } }
void OnTriggerEnter(Collider other) { if (other.gameObject.CompareTag(GameTag.Player)) { Time.timeScale = 0; //Invoke("loadNextLevel", m_time); StartCoroutine(loadNextLevel()); if (OnLevelComplete != null) { OnLevelComplete.Invoke(new LevelCompleteZoneEventData(other.gameObject)); } } }
/// <summary> /// Called everytime a win condition is met. The condition GameObject is added to a list. /// When enough win conditions are met the level managers calls the LevelComplete event. /// A gameobject can only have one appearance in each list. /// </summary> private void WinConditionMet(GameObject condition) { if (!winConditionsList.Contains(condition)) { winCounter++; winConditionsList.Add(condition); if (winCounter >= winConditionsToWin) { if (!levelAlreadyEnded) { levelAlreadyEnded = true; OnLevelComplete?.Invoke(); DestroyAllObjectsInScene(sceneObjects); } } } }
void StartCountdown() { state = SpawnStates.COUNTING; TimeLeft = timeBetweenWaves; if (nextWave > waves.Length - 2) { OnLevelComplete.Invoke(); state = SpawnStates.WON; } else { nextWave++; onCountdown.Invoke(); } waveCompleted = false; }
public void InitiateLevelComplete() { animator.SetBool("success", true); OnLevelComplete?.Invoke(); }
private void Tp_OnLevelComplete(object sender, System.EventArgs e) { OnLevelComplete?.Invoke(sender, e); }
private void LevelComplete() { OnLevelComplete?.Invoke(); //SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex); }
public void LevelComplete() { // Scene transition/UI overlay OnLevelCompletecallback.Invoke(); }
public static void LevelComplete() { OnLevelComplete?.Invoke(); }