HealthController Update
This commit is contained in:
parent
6fb48d423d
commit
aaf8c48d5a
1 changed files with 3 additions and 4 deletions
|
@ -13,7 +13,7 @@ public class HealthbarController : MonoBehaviour {
|
||||||
{
|
{
|
||||||
// if player alive and spawned
|
// if player alive and spawned
|
||||||
if (player != null)
|
if (player != null)
|
||||||
{
|
{
|
||||||
//Debug.Log(player.GetHealth());
|
//Debug.Log(player.GetHealth());
|
||||||
UpdatePointer(player.GetHealth());
|
UpdatePointer(player.GetHealth());
|
||||||
}
|
}
|
||||||
|
@ -28,14 +28,13 @@ public class HealthbarController : MonoBehaviour {
|
||||||
float offset;
|
float offset;
|
||||||
|
|
||||||
if (player == null) {
|
if (player == null) {
|
||||||
currentRotation = 0;
|
offset = -currentRotation;
|
||||||
offset = 0;
|
|
||||||
Debug.Log("Player not found");
|
Debug.Log("Player not found");
|
||||||
} else {
|
} else {
|
||||||
//Debug.Log("calculated offset");
|
//Debug.Log("calculated offset");
|
||||||
offset = ((playerLife / maxRotation) * 100) - currentRotation;
|
offset = ((playerLife / maxRotation) * 100) - currentRotation;
|
||||||
}
|
}
|
||||||
|
offset /= 10;
|
||||||
gameObject.transform.Rotate(Vector3.forward, offset);
|
gameObject.transform.Rotate(Vector3.forward, offset);
|
||||||
currentRotation += offset;
|
currentRotation += offset;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue