How do extension methods work?
I want to make an extension method in Unity3d for the Vector3 class. But I don't quite seem to get it. This is what I have: public static class ExtensionMethods{ public static Vector3 MaxValue(this Vector3 _vec3) { return new Vector3(float.MaxValue,float.MaxValue,float.MaxValue); } } Now I want to make a Vector3.MaxValue just like float.MaxValue with this line of code: Vector3 closestPoint = Vector3.MaxValue; But then I get this error: error CS0117: `UnityEngine.Vector3' does not contain a definition for `MaxValue' I know that this would work: Vector3 closestPoint = new Vector3().MaxValue();