Ejemplo n.º 1
0
 public void RespawnPlayer()
 {
     Debug.Log("Player Respawn");
     healthManager.FullHealth();
     healthManager.isDead      = false;
     player.transform.position = currentCheckpoint.transform.position;
     player.GetComponent <SpriteRenderer>().color = new Color(1, 1, 1, 1);
 }
Ejemplo n.º 2
0
    public IEnumerator RespawnPlayerCo()
    {
        Physics2D.IgnoreLayerCollision(9, 10, false);
        player.gameObject.SetActive(false);
        yield return(new WaitForSeconds(respawnDelay));

        player.transform.position = currentCheckPoint.transform.position;
        Debug.Log("Player Respawned");
        Physics2D.IgnoreLayerCollision(9, 10, false);
        player.gameObject.SetActive(true);
        playerHealthManager.FullHealth();
        playerHealthManager.isDead = false;
    }
Ejemplo n.º 3
0
    public void RespawnPlayer()
    {
        //Debug.Log("Player respawn");
        //   player.transform.position = currentCheckPoint.transform.position;
        ScoreManager.AddPoints(-penaltyOnDeath);
        if (MainMenu.playerMode == 2)
        {
            StartCoroutine(SecondPlayer());
        }

        healthManager.FullHealth();
        healthManager.isDead = false;
        ScoreManager.ResetPoints();

        //Instantiate(player, checkPoint.position, checkPoint.rotation);
        player.transform.position = currentCheckPoint.transform.position;
    }
Ejemplo n.º 4
0
    public IEnumerator RespawnPlayerCo()
    {
        Instantiate(deathParticle, player.transform.position, player.transform.rotation);
        player.enabled = false;
        //player.GetComponent<Renderer>().enabled;
        ScoreManager.AddPoints(-pointPenaltyOnDeath);
        Debug.Log("Player Respawn");
        yield return(new WaitForSeconds(respawnDelay));

        player.transform.position = currentCheckpoint.transform.position;
        player.enabled            = true;
        //player.GetComponent<Renderer>().enabled;
        Instantiate(respawnParticle, currentCheckpoint.transform.position, currentCheckpoint.transform.rotation);


        player.enabled = true;

        healthManager.FullHealth();
    }
    public IEnumerator RespawnPlayerCo()
    {
        Instantiate(deathParticle, player.transform.position, player.transform.rotation);
        player.enabled = false;
        player.GetComponent <Renderer>().enabled = false;
        camera.isFollowing    = false;
        player.knockbackCount = 0;
        //gravityStore = player.GetComponent<Rigidbody2D>().gravityScale;
        //player.GetComponent<Rigidbody2D>().gravityScale = 0f;
        //player.GetComponent<Rigidbody2D>().velocity = Vector2.zero;
        ScoreManager.AddPoints(-pointPenaltyOnDeath);
        Debug.Log("Player Respawn");
        yield return(new WaitForSeconds(respawnDelay));

        //player.GetComponent<Rigidbody2D>().gravityScale = gravityStore;
        player.transform.position = currentCheckpoint.transform.position;
        player.enabled            = true;
        player.GetComponent <Renderer>().enabled = true;
        playerHealthManager.FullHealth();
        playerHealthManager.isDead = false;
        camera.isFollowing         = true;
        Instantiate(respawnParticle, currentCheckpoint.transform.position, currentCheckpoint.transform.rotation);
    }