// Called automatically by Unity when the script first exists in the scene. void Awake() { AudioInit(); m_Animator = GetComponent <Animator>(); m_CharCtrl = GetComponent <CharacterController>(); m_entity = GetComponent <NetworkEntity>(); m_healthUI = GameObject.FindObjectOfType <HealthUI>(); m_entity.behavior = this; }
public void Heal(int maxHitPointsAdd, int currentHitPointsAdd) { this.maxHitPoints += maxHitPointsAdd; this.currentHitPoints += currentHitPointsAdd; if (_healthUi == null) { _healthUi = FindObjectOfType <HealthUI>(); } _healthUi.ChangeHitPointUI(this); }
public void ResetHP(HealthUI healthUI) { currentHitPoints = maxHitPoints; m_timeSinceLastHit = 0.0f; healthUI.ResetHP(); }