Example #1
0
 public void SetActorToFollow(IActor actor)
 {
     _movementData   = actor.GetData <MovementData>();
     _transformData  = actor.GetData <TransformData>();
     _rotationData   = actor.GetData <RotationData>();
     _actorTransform = _transformData.GetTransform();
 }
Example #2
0
        protected override void OnInitialize(IActor owner)
        {
            ITransformData ownerTransformData = Owner.GetData <TransformData>();

            _ownerActorTransform = ownerTransformData.GetTransform();

            base.OnInitialize(owner);
        }
        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);
            }
        }
Example #4
0
        public void SetActorToFollow(IActor actor)
        {
            ITransformData actorTransformData = actor.GetData <TransformData>();

            _followingActorTransform = actorTransformData.GetTransform();
        }
        private void Cast(object sender, EventArgs e)
        {
            var activeSpell = _spellData.Spells[_caster.Id];

            activeSpell.Cast(_caster.SpawnPoint, _ownerTransformData.GetTransform().forward);
        }