// Update is called once per frame void Update() { if (_cameraFlag && _environmentFlag) { _playerHealthHandler.SetHealth(0); } }
void PlayerRespawn() { _playerHealthHandler.SetHealth(_playerHealthHandler._maxHP); _isInvincible = true; _playerAnimator.SetBool("isInvincible", _isInvincible); _isDead = false; transform.position = _playerRespawnPoint; _playerControls.EnableControls(); _playerCollider.enabled = true; _playerSpriteRenderer.enabled = true; }
private void Update() { if (networkObject.IsOwner) { // If we are the owner of the object we should send the new position // and rotation across the network for receivers to move to in the above code networkObject.position = transform.position; networkObject.rotation = transform.rotation; networkObject.isDead = m_aiMonster.IsDead; networkObject.health = m_healthHandler.GetHealth(); } else { transform.position = networkObject.position; transform.rotation = networkObject.rotation; if (networkObject.isDead) { m_aiMonster.OnDeath(); } m_healthHandler.SetHealth(networkObject.health); } }