Null check so that buildings dont need an animator

This commit is contained in:
craftwill 2024-10-27 15:57:26 -04:00
parent 12e5f4bc55
commit 507b2ce8e0

View File

@ -77,9 +77,14 @@ public class AnimationEntity : MonoBehaviour
}
public void PlayDieAnim()
{
// Not every entity needs an animator
if (_animatorEntity != null)
{
_animatorEntity.speed = 1;
_animatorEntity.Play("die", 0, 0f);
}
entityState = EntityAnimationState.Dying;
_doSomething = true;
_isDead = true;