Pro_Unit

CorrectRadius

Feb 16th, 2021 (edited)
341
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.34 KB | None | 0 0
  1. private void CorrectRadius()
  2. {
  3.     bool isAnyHit = false;
  4.     foreach (var checker in _checkers)
  5.         if (checker.IsHit(out float distance))
  6.         {
  7.             _radius = Mathf.Lerp(_radius, distance, _radiusLerpSpeed);
  8.             isAnyHit = true;
  9.         }
  10.  
  11.     if (isAnyHit || _radius == _rayDistance) return;
  12.  
  13.     _radius = Mathf.Lerp(_radius, _rayDistance, _radiusLerpSpeed);
  14. }
Add Comment
Please, Sign In to add comment