Hello !
I got a problem and I’m kinda plox ! I did a certain amount of code in C, and moving to a Object oriented code, C#, gives me some headhaches. Especially when it comes to code structure. I pretty much got the point about objects having parameters and methods. Which bug me is how to use generic code.
For example, let’s say the method Abs (absolute value) doesn’t exist and I want to create one. A lot of others scripts need it. What is the most proper way to make this method. So far I managed to have something working :
class TheTest
{
public static float Abs2(float i)
{
if (i < 0)
return -i;
return i;
}
}
//...
Debug.Log(TheTest.Abs2(-10));
Going further, I wonder if there is a better way, or if it’s possible to create a kind of “Library” that I can refer with using so I have those available in any projects ?
Thanks in advance !