healer grippler
This commit is contained in:
parent
ed56823425
commit
4572318c06
|
@ -5038,7 +5038,7 @@ MonoBehaviour:
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
bounciness: 1
|
bounciness: 1
|
||||||
damage: 10
|
damage: -10
|
||||||
wallRebounces: 4
|
wallRebounces: 4
|
||||||
comingFrom: {fileID: 0}
|
comingFrom: {fileID: 0}
|
||||||
OnReflect:
|
OnReflect:
|
||||||
|
|
|
@ -29,7 +29,7 @@ public class HealthComponent : MonoBehaviour
|
||||||
OnHealthChangeAtPos?.Invoke(transform.position, currentHealth - damage);
|
OnHealthChangeAtPos?.Invoke(transform.position, currentHealth - damage);
|
||||||
currentHealth -= damage;
|
currentHealth -= damage;
|
||||||
|
|
||||||
currentHealth = (int)Mathf.Clamp(currentHealth, 0f, Mathf.Infinity);
|
currentHealth = (int)Mathf.Clamp(currentHealth, 0f, startHealth);
|
||||||
if (currentHealth == 0)
|
if (currentHealth == 0)
|
||||||
OnHealthZero?.Invoke();
|
OnHealthZero?.Invoke();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue