mirror of
https://github.com/FriendshipIsEpic/FiE-Game.git
synced 2024-11-29 16:37:59 +01:00
30 lines
649 B
C#
30 lines
649 B
C#
using Fie.Object;
|
|
|
|
namespace Fie.UI
|
|
{
|
|
public class FieGameUIPlayerLifeGauge : FieGameUILifeGaugeBase
|
|
{
|
|
public new void OnEnable()
|
|
{
|
|
base.OnEnable();
|
|
if (base.ownerCharacter != null)
|
|
{
|
|
base.ownerCharacter.damageSystem.damagedEvent += lifeSystem_damageEvent;
|
|
}
|
|
isEnableAutoDamageAnimation = false;
|
|
}
|
|
|
|
private void OnDisable()
|
|
{
|
|
if (base.ownerCharacter != null)
|
|
{
|
|
base.ownerCharacter.damageSystem.damagedEvent -= lifeSystem_damageEvent;
|
|
}
|
|
}
|
|
|
|
private void lifeSystem_damageEvent(FieGameCharacter attacker, FieDamage damage)
|
|
{
|
|
_skeletonAnimation.state.SetAnimation(1, "damage", loop: false);
|
|
}
|
|
}
|
|
}
|