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()
|
public void PlayDieAnim()
|
||||||
{
|
{
|
||||||
_animatorEntity.speed = 1;
|
// Not every entity needs an animator
|
||||||
_animatorEntity.Play("die", 0, 0f);
|
if (_animatorEntity != null)
|
||||||
|
{
|
||||||
|
_animatorEntity.speed = 1;
|
||||||
|
_animatorEntity.Play("die", 0, 0f);
|
||||||
|
}
|
||||||
|
|
||||||
entityState = EntityAnimationState.Dying;
|
entityState = EntityAnimationState.Dying;
|
||||||
_doSomething = true;
|
_doSomething = true;
|
||||||
_isDead = true;
|
_isDead = true;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user