Hello everyone, I spent 2 or so months writing, optimizing and compiling different scripts for you to use. You can use these scripts, credit would be nice. If you have any suggestions please tell me.
@ indicates that you should interact with this. (call a function, add items to a list...) ! indicates the answer/return. # indicates a private variable/function/list that you should not touch. $ indicates a constant. Includes: Delta Time - calculates time between frames in seconds, milliseconds and counts the FPS. days since 2000 and timer implementations. Lerp - linearly interpolates from one value to another with a given distance. Inverse Lerp - determines what fraction a given value lies between two points. Lerp Angle - Lerp for angles. Exponential Decay - Lerp, but framerate independent. Power - aᵇ. Bitshift - Shifts bits! Clamp - Restricts a value between a minimum and a maximum. Flip Value - turns True -> False, positive numbers -> negative numbers (and vice versa). Average - Finds the average of 2 numbers. Average - Finds the average of all numbers in a list. Max - Returns the bigger value. Min - Returns the smaller value. Sign - Returns whether a number is positive 1, negative -1 or zero 0. Move Towards 1D/2D - glide (t) secs to xy without time dependency. 2D/3D Distance - Finds the distance between 2 or 3 points. Ping Pong - Unity's Ping Pong function. (note: this could be improved https://www.youtube.com/watch?v=k_QrWF_jGFE) Is Key Down - Returns whether the key is being pressed. Get Keys Down - Returns a list of keys that are being pressed. Key Pair Weight - Useful for movement: key (d) pressed? - key (a) pressed?. Timer - A timer that supports different processes. Degree to Radian - Converts degrees to radians. Radian to Degree - Converts radians to degrees. Coord to Angle - Converts a 2D coordinate into an angle in degrees. Compact List Encoder - Converts a list to a single string, separating each value with a separator. Compact List Decoder - Converts an encoded string back into a list. Normalize Vector - Returns a Vector of length 1. Is Point Inside Circle/Rectangle/Triangle - Returns whether a point is inside a specified area or a shape. Is List Sorted - Returns whether a list is sorted. Sort List - Uses Heapsort to sort a list quickly. Linear List Search - Loops through the list to find a value. Binary List Search - Performs Binary Search on a list to find a value. String Search - Finds all pattern matches inside a string. Draw Rectangle - Draws a rectangle with optional rounded corners.