Пример #1
0
        bool MoveTowardsTarget(float deltaTime)
        {
            //var displacement = _targetDirection * _speed;

            //if(Vector3.Distance(_movingTransform.position, _target) < displacement.magnitude)
            //{
            //    _movingTransform.position = _target;
            //    return true;
            //}

            //_movingTransform.Translate(displacement);
            //return false;
            _movingTransform.position = Vector3.MoveTowards(_movingTransform.position, _target, _speed * deltaTime);
            return(VectorUtils.ApproximatelyEqual(_movingTransform.position, _target, .1f));
        }