mirror of
https://github.com/GTA-ASM/SanAndreasUnity
synced 2024-11-15 00:37:09 +00:00
fix errors
This commit is contained in:
parent
c77f6c471d
commit
ef83e9aed5
2 changed files with 5 additions and 3 deletions
|
@ -33,8 +33,8 @@ namespace SanAndreasUnity.Behaviours
|
||||||
{
|
{
|
||||||
this.HealthBar = Object.Instantiate (GameManager.Instance.barPrefab, this.transform).GetComponentOrThrow<Bar> ();
|
this.HealthBar = Object.Instantiate (GameManager.Instance.barPrefab, this.transform).GetComponentOrThrow<Bar> ();
|
||||||
// this.HealthBar.SetBorderWidth (0.1f);
|
// this.HealthBar.SetBorderWidth (0.1f);
|
||||||
this.HealthBar.BackgroundColor = UI.HUD.Instance.healthBackgroundColor;
|
this.HealthBar.BackgroundColor = PedManager.Instance.healthBackgroundColor;
|
||||||
this.HealthBar.FillColor = UI.HUD.Instance.healthColor;
|
this.HealthBar.FillColor = PedManager.Instance.healthColor;
|
||||||
this.HealthBar.BorderColor = Color.black;
|
this.HealthBar.BorderColor = Color.black;
|
||||||
|
|
||||||
this.UpdateHealthBar ();
|
this.UpdateHealthBar ();
|
||||||
|
@ -72,7 +72,7 @@ namespace SanAndreasUnity.Behaviours
|
||||||
rect.height = Mathf.Min (rect.height, PedManager.Instance.healthBarMaxScreenHeight);
|
rect.height = Mathf.Min (rect.height, PedManager.Instance.healthBarMaxScreenHeight);
|
||||||
|
|
||||||
float borderWidth = Mathf.Min( 2f, rect.height / 4f );
|
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 );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,6 +24,8 @@ namespace SanAndreasUnity.Behaviours
|
||||||
public float healthBarWorldHeight = 0.1f;
|
public float healthBarWorldHeight = 0.1f;
|
||||||
public float healthBarMaxScreenHeight = 20f;
|
public float healthBarMaxScreenHeight = 20f;
|
||||||
public float healthBarVerticalOffset = 0.3f;
|
public float healthBarVerticalOffset = 0.3f;
|
||||||
|
public Color healthColor = Color.red;
|
||||||
|
public Color healthBackgroundColor = (Color.red + Color.black) * 0.5f;
|
||||||
|
|
||||||
[Header("Ped AI")]
|
[Header("Ped AI")]
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue