Exemplo n.º 1
0
 private void OnTriggerEnter(Collider other)
 {
     if (other.CompareTag("Player"))
     {
         FindObjectOfType<LevelManager>().SetCheckPoint(other.transform.position);
         PodBreak.ClearPodCache();
         CacheOnCheckpoint.ClearCache();
         Destroy(gameObject);
         onSetCheckpoint();
     }
 }
Exemplo n.º 2
0
    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();
    }
Exemplo n.º 3
0
 void Awake()
 {
     this.coc = this.gameObject.AddComponent <CacheOnCheckpoint>();
 }