void Awake() { _playerController = GetComponent <PlayerController>(); _gunController = GetComponent <GunController>(); HealthDisplaySystem.DisplayHP(true); }
void Awake() { HealthDisplaySystem.DisplayHP(true); HealthDisplaySystem.SetMaxHP(maxHealth, true); _health = maxHealth; transform.Find("Dead").gameObject.SetActive(false); }
void Awake() { if (instance != null) { Destroy(this); return; } instance = this; MaxHP = 6; CurrentHP = MaxHP; UpdateRender(); DisplayHP(false); }
public void AdjustHealth(int value, Vector3 direction = default) { if (Dead) { return; } _health = Mathf.Clamp(_health + value, 0, maxHealth); HealthDisplaySystem.SetCurrentHP(_health); FindObjectOfType <CameraController>().ApplyCameraShake(); if (_health == 0) { Dead = true; StartCoroutine(OnDead(direction)); } }