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(); }
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; }
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); // } //} }