void Start() { aiPath = GetComponent <AIPath>(); aiPath.canMove = false; interactable = GetComponent <Interactable>(); interactable.OnInteract += OnInteract; gameManager = GameObject.FindGameObjectWithTag("GameManager").GetComponent <GameManager>(); headAnimator = GetComponent <HeadReference>().Head.GetComponent <HeadAnimator>(); }
public void Update() { var speed = 0.1f; HeadAnimator?.Update(speed); if (_jumpComponent.Jumping) { HeadAnimator?.SetAnimation("Jump"); } else if (Math.Abs(_moveComponent.XVelocity) > 0.01f) { HeadAnimator?.SetAnimation("Walk"); } else { HeadAnimator?.SetAnimation("Idle"); } }