Preferrably I don’t want to have to “find” the script or make an instance of it with a singleton work-around to use its functions and stuff, is there any way to make the script open and accessable from another script as if the function was right here, except by namespace?
like if I have mathutils.cs:
class mathutils {
void multiplication(int x, int y) {whatevz;}
}
And then in another script called gamelogic.cs I’d like to be able to just write mathutils.multiplication(1, 2); anywhere in the gamelogic.cs.
Is this possible? mathutils needs to be singleton, but I’d like to be able to also create instances of subclasses inside mathutils if possible.
On an unrelated note, it’s good practice to use capital casing for your class names (e.g. MathUtils instead of mathutils) to separate them from variables, which usually use lower camel-casing (e.g. myVar instead of myvar or MyVar). It keeps your code neat and prevents confusion later.