示例#1
0
 void OnTriggerEnter(Collider other)
 {
     if (other.CompareTag("Ball"))
     {
         PlayerRespawn.Respawn();
     }
 }
示例#2
0
    void Update()
    {
        RaycastHit hit;

        if (Physics.Linecast(transform.position + Vector3.up * CheckDistanceUp, transform.position - Vector3.up * CheckDistanceDown, out hit, groundLayer))
        {
            if (grounded == false)
            {
                OnIce    = hit.collider.tag == "Ice";
                grounded = true;
                Landed.Invoke();
            }
        }
        else
        {
            if (grounded == true)
            {
                grounded = false;
                Jumped.Invoke();
            }

            if (view.IsMine && transform.position.y < -20)
            {
                respawn.Respawn();
            }
        }
    }
示例#3
0
 public void Revive()
 {
     revivetimer.timeLeft = 5;
     PlayerHealth.health  = 3;
     DeathMenu.SetActive(false);
     player.SetActive(true);
     ReviveLimit -= 1;
     playerRespawn.Respawn();
 }
示例#4
0
    private void OnCollisionEnter2D(Collision2D collision)
    {
        if (collision.gameObject.tag == "Player")
        {
            PlayerRespawn playerRespawn = collision.gameObject.GetComponent <PlayerRespawn>();

            playerRespawn.Respawn();
        }
    }
示例#5
0
    private void OnCollisionEnter2D(Collision2D collision)
    {
        // This code gets called each frame player is inside trigger.
        if (collision.gameObject.tag == "Player")
        {
            PlayerRespawn playerRespawn =
                collision.gameObject.GetComponent <PlayerRespawn>();

            playerRespawn.Respawn();
        }
    }