Null check so that buildings dont need an animator
This commit is contained in:
parent
12e5f4bc55
commit
507b2ce8e0
@ -78,8 +78,13 @@ public class AnimationEntity : MonoBehaviour
|
||||
|
||||
public void PlayDieAnim()
|
||||
{
|
||||
_animatorEntity.speed = 1;
|
||||
_animatorEntity.Play("die", 0, 0f);
|
||||
// Not every entity needs an animator
|
||||
if (_animatorEntity != null)
|
||||
{
|
||||
_animatorEntity.speed = 1;
|
||||
_animatorEntity.Play("die", 0, 0f);
|
||||
}
|
||||
|
||||
entityState = EntityAnimationState.Dying;
|
||||
_doSomething = true;
|
||||
_isDead = true;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user