回答編集履歴
1
メソッド名修正:Clamp -> Clamp01
answer
CHANGED
@@ -27,7 +27,7 @@
|
|
27
27
|
public void DecreaseHp()
|
28
28
|
{
|
29
29
|
HP -= 1;
|
30
|
-
var currentHPPercentage = Mathf.
|
30
|
+
var currentHPPercentage = Mathf.Clamp01(HP / (float)MaxHP);
|
31
31
|
this.hpGauge.GetComponent<Image>().fillAmount = currentHPPercentage;
|
32
32
|
if (HP <= 0)
|
33
33
|
{
|