private void OnTriggerEnter(Collider other) { if (other.CompareTag("Player")) { FindObjectOfType<LevelManager>().SetCheckPoint(other.transform.position); PodBreak.ClearPodCache(); CacheOnCheckpoint.ClearCache(); Destroy(gameObject); onSetCheckpoint(); } }
private void LoadThisLevel() { //SceneManager.LoadScene(SceneManager.GetActiveScene().name); this.WarpPlayer(this.checkpointPosition); isGameOver = false; CellPrimeBehavior cellPrime = FindObjectOfType <CellPrimeBehavior>(); if (cellPrime != null) { cellPrime.Checkpoint(); } onLevelReset.Invoke(); if (canBreakPods) { PodBreak.ResetPodCache(); } FindObjectOfType <GrappleHandController>().DeactivatePowerups(); GivePowerup.ResetPowerupTimers(); CacheOnCheckpoint.ResetCache(); FindObjectOfType <PowerUpSlider>().SetValue(0); FindObjectOfType <GrappleHandController>().ResetToResting(); FindObjectOfType <GrappleHandController>().controlState = ControlState.Retracting; EnemyAI[] enemies = FindObjectsOfType <EnemyAI>(); foreach (EnemyAI enemy in enemies) { enemy.state = EnemyAI.FSMStates.Patrol; enemy.anim.enabled = true; } DisableGameOverText(); }