Exemple #1
0
 public void Reset()
 {
     Level.Rotation = Vector3.Zero;
     Translation    = Level.GetNode <Spatial>("SpawnPoint").GlobalTransform.origin;
     ShouldKill     = false;
     velocity       = Vector3.Zero;
     Respawn?.Invoke();
     RotationDir = 1;
     Visible     = true;
     CalibrateCamera?.Invoke();
 }
Exemple #2
0
    private void RPC_TakeDamage(int _damage, PhotonMessageInfo _info)
    {
        if (IsDeath() && photonView.IsMine)
        {
            //gameObject.SetActive(false);
            PhotonNetwork.Destroy(this.gameObject);
            if (globalCamera)
            {
                globalCamera.SetActive(true);
            }

            Respawn?.Invoke(3);

            return;
        }

        Heath -= _damage;
    }
Exemple #3
0
    private void OnTriggerEnter2D(Collider2D collision)
    {
        playerController.playerHP--;
        if (playerController.playerHP <= 0)
        {
            gameOverText.gameObject.SetActive(true);
            respawn.Invoke("GameOver", 3);
        }

        //if (collision.gameObject.CompareTag("Player"))
        //{
        //    if (playerController.facingRight)
        //    {
        //        collision.attachedRigidbody.AddForce(-collision.attachedRigidbody.velocity.normalized * pushback);
        //    }
        //    else if (!playerController.facingRight)
        //    {
        //        collision.attachedRigidbody.AddForce(collision.attachedRigidbody.velocity.normalized * pushback);
        //    }
        //}
    }