Example #1
0
 public void OnGrabberNear(Grabber grabber)
 {
     if (_goingToTarget)
     {
         return;
     }
     _goingToTarget = true;
     _grabber       = grabber;
     StartCoroutine(_goToTargetFunction(grabber));
 }
Example #2
0
        private IEnumerator GoToTarget(Grabber target)
        {
            var grabberTransform = target.transform;

            _reachedTarget = false;
            while (!_reachedTarget)
            {
                var currentPosition = transform.position;
                transform.position = Vector3.SmoothDamp(currentPosition, grabberTransform.position, ref _velocity, SmoothSpeed, speed);
                yield return(null);
            }
        }
Example #3
0
 protected abstract void Grabbed(Grabber grabber);