Fixed health bar glitches
This commit is contained in:
@@ -9,7 +9,15 @@ namespace InterfaceOff.WorldScene
|
|||||||
|
|
||||||
private void Update()
|
private void Update()
|
||||||
{
|
{
|
||||||
HealthBarObject.localScale = new Vector3(100f, (20 - Spawner.SpawnedWindowCount) * 5f, 100f);
|
float scale = (20 - Spawner.SpawnedWindowCount) * 5f;
|
||||||
|
scale = Mathf.Clamp(scale, 0f, Mathf.Infinity);
|
||||||
|
|
||||||
|
if (!Spawner.AutoSpawn)
|
||||||
|
{
|
||||||
|
scale = 0f;
|
||||||
|
}
|
||||||
|
|
||||||
|
HealthBarObject.localScale = new Vector3(100f, scale, 100f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user