public OneUnitHealthController(IUnitSettings unitSettings, Camera camera) { _unit = unitSettings.GraphicObject; _lookAtCameraController = _unit.GetComponentInChildren(typeof(LookAtCameraController)) as LookAtCameraController; _lookAtCameraController.main_camera = camera; _healthBarController = _unit.GetComponentInChildren(typeof(HealthBarController)) as HealthBarController; _healthBarController.Set(1.0f); _healthBarGameObject = _unit.transform.Find("healthbar").gameObject; }
public void SetHealthBarValue(float value) { _healthBarController.Set(value); }
/// <summary> /// Reset vars for new battle /// </summary> public void Reset() { _currentHealth = 1f; _health.Set(_currentHealth); SetStatus(UnitStatus.READY); }