public void UpdateHealthCount(HealthUIData healthUI) { if (OnHealthBarUpdate != null) { OnHealthBarUpdate(healthUI); } }
public void OnHealthBarUpdate(HealthUIData healthUI) { if (PlayerID == healthUI.playerID) { healthCount.text = healthUI.health.ToString() + " / " + healthUI.maxHealth.ToString(); } }
public void HealthChanged(HealthUIData healthData) { if (OnHealthChanged != null) { OnHealthChanged(healthData); } }
public void OnHealthChanged(HealthUIData healthData) { if (healthData.playerID == PlayerID) { if (slider.maxValue == 1) { SetMaxHealth(healthData.maxHealth); } slider.value = healthData.health; //Debug.Log("health set to " + healthData.health); EventSystem.Instance.UpdateHealthCount(healthData); } }