How can I create a "Library" in C# containing my functions?

Hi, I have made several functions in C# and I want to be able to call them in any unity script (like
we do for example with Mathf).

I am thinking something like the following. Let’s say that I have made some functions Myfunction1(),…,MyfunctionN() in a script named MyScript. I want to know if there is any way to make a library named MyLibrary and whenever I want to call the above functions in another script (let’s say in MyScript2) I will call them by MyLibrary.Myfunction1().

Is that possible? How can I do this?

(I searched a bit online but I couldn’t find something. Maybe I don’t know the correct terminology.)

Make a Helper class and make the methods static. For example;

public class Helpers
{
    public static Vector3 Vector3MinusFloatValue(Vector3 v, float f)
    {
        return new Vector3(v.x - f, v.y - f, v.z - f);
    }

    public static int MinusFive(int value)
    {
        return value - 5;
    }
}

Then you can just call the functions with Helper.Method

Adding to the other answer, you can create extension methods. The difference is how you call them.

With a normal class:

public static class Helper
{
      public static Vector3 Vector3MinusFloatValue(Vector3 v, float f)
     {
         return new Vector3(v.x - f, v.y - f, v.z - f);
     } 
}

and you call as:

 Vector3 vec = new Vector3(10,10,10);
 Vector3 newVec = Helper.Vector3MinusFloatValue(vec, 2f);

now with extension:

public static class Helper
{
      public static Vector3 Vector3MinusFloatValue(this Vector3 v, float f)
     {
         return new Vector3(v.x - f, v.y - f, v.z - f);
     } 
}

Notice the “this” in front of the first parameter, this is what makes it all. And now you use as:

 Vector3 vec = new Vector3(10,10,10);
 Vector3 newVec = vec.Vector3MinusFloatValue(2f);

So there we go, same same but different.