fix errors

This commit is contained in:
in0finite 2020-04-22 23:26:55 +02:00
parent c77f6c471d
commit ef83e9aed5
2 changed files with 5 additions and 3 deletions

View file

@ -33,8 +33,8 @@ namespace SanAndreasUnity.Behaviours
{
this.HealthBar = Object.Instantiate (GameManager.Instance.barPrefab, this.transform).GetComponentOrThrow<Bar> ();
// this.HealthBar.SetBorderWidth (0.1f);
this.HealthBar.BackgroundColor = UI.HUD.Instance.healthBackgroundColor;
this.HealthBar.FillColor = UI.HUD.Instance.healthColor;
this.HealthBar.BackgroundColor = PedManager.Instance.healthBackgroundColor;
this.HealthBar.FillColor = PedManager.Instance.healthColor;
this.HealthBar.BorderColor = Color.black;
this.UpdateHealthBar ();
@ -72,7 +72,7 @@ namespace SanAndreasUnity.Behaviours
rect.height = Mathf.Min (rect.height, PedManager.Instance.healthBarMaxScreenHeight);
float borderWidth = Mathf.Min( 2f, rect.height / 4f );
GUIUtils.DrawBar( rect, this.Health / this.MaxHealth, UI.HUD.Instance.healthColor, UI.HUD.Instance.healthBackgroundColor, borderWidth );
GUIUtils.DrawBar( rect, this.Health / this.MaxHealth, PedManager.Instance.healthColor, PedManager.Instance.healthBackgroundColor, borderWidth );
}

View file

@ -24,6 +24,8 @@ namespace SanAndreasUnity.Behaviours
public float healthBarWorldHeight = 0.1f;
public float healthBarMaxScreenHeight = 20f;
public float healthBarVerticalOffset = 0.3f;
public Color healthColor = Color.red;
public Color healthBackgroundColor = (Color.red + Color.black) * 0.5f;
[Header("Ped AI")]