I’d like to create some utilities functions that can be access from other c# scripts, but can’t figure out how to access them. I’m used to programming in c++ and those approaches don’t seem to work.
For instance, I’d like to have the following function in a utilities.cs file:
public float map(float s, float a1, float a2, float b1, float b2){
return b1 + (s-a1)*(b2-b1)/(a2-a1);
}
Then in all of my other c# files I’d like to be able to just call that function as if it was part of unity… such as:
float temp = map(10,0,20,10,50);
How can this be done?