Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Find horizontal limit for current h and clamp it to maxValue
- MoveLimit currentHorizontalLimit = limitList.Find(x => x.inputLimit <= Mathf.Abs(h));
- if (currentHorizontalLimit != null)
- {
- h = currentHorizontalLimit.maxValueWithinLimit * Mathf.Sign(h);
- }
- //Find vertical limit for current v and clamp it to max value
- MoveLimit currentVerticalLimit = limitList.Find(x => x.inputLimit <= Mathf.Abs(v));
- if (currentVerticalLimit != null)
- {
- v = currentVerticalLimit.maxValueWithinLimit * Mathf.Sign(v);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement