Advertisement
Guest User

Untitled

a guest
Oct 18th, 2019
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.60 KB | None | 0 0
  1.         //Find horizontal limit for current h and clamp it to maxValue
  2.         MoveLimit currentHorizontalLimit = limitList.Find(x => x.inputLimit <= Mathf.Abs(h));
  3.         if (currentHorizontalLimit != null)
  4.         {
  5.             h = currentHorizontalLimit.maxValueWithinLimit * Mathf.Sign(h);
  6.         }
  7.  
  8.         //Find vertical limit for current v and clamp it to max value
  9.         MoveLimit currentVerticalLimit = limitList.Find(x => x.inputLimit <= Mathf.Abs(v));
  10.         if (currentVerticalLimit != null)
  11.         {
  12.             v = currentVerticalLimit.maxValueWithinLimit * Mathf.Sign(v);
  13.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement