So pretty much what I want to know is if it’s possible to create a ‘library’ full of scripts that you can call from anywhere that aren’t attached to a GameObject and possibly not a static function much like JavaScripts Mathf.
so let’s say I called my library libgerr and had a function in it called functgurr I want to be able to go into any script and just say libgurr.functgurr(variables) and it would do whatever it’s meant to do.
Is it possible?
Mathf is a static class containing static methods. They are easy to create:
public static class MyLib {
public static bool Approx(float a, float b, float epsilon = 0.2f) { return Mathf.Abs(a-b) < epsilon; }
}
if(MyLib.Approx(1,1.1f)) {
}