FiE-Game/Assets/Scripts/Fie/UI/FieGameUIPlayerLifeGauge.cs

31 lines
649 B
C#
Raw Normal View History

2018-11-20 20:10:49 +01:00
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);
}
}
}