public override void Tick() { _navMeshAgent.SetDestination(_followActor.GetData <TransformData>().GetTransform().position); _navMeshAgent.nextPosition = _transformData.GetTransform().position; var reachedTarget = _navMeshAgent.remainingDistance < _aiNavigationData.ReachDistance; _animationData.GetAnimator().SetBool(_animationData.MovingAnimationKey, !reachedTarget); if (reachedTarget) { _animationData.GetAnimator().SetTrigger(_animationData.AttackAnimationKey); } }
protected override void OnInitialize(IActor owner) { base.OnInitialize(owner); _animationData = Owner.GetData <AnimationData>(); _animator = _animationData.GetAnimator(); _movementData = Owner.GetData <MovementData>(); _bindingData = Owner.GetData <KeyBindingsData>(); _horizontalKeyAxis = _bindingData.HorizontalKeyAxis(); _verticalKeyAxis = _bindingData.VerticalKeyAxis(); }