public void OnGrabberNear(Grabber grabber) { if (_goingToTarget) { return; } _goingToTarget = true; _grabber = grabber; StartCoroutine(_goToTargetFunction(grabber)); }
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); } }
protected abstract void Grabbed(Grabber grabber);