Overload Vector3's operator +

Is is possible to overload Vector3’s operator + using C# extension methods? What I specifically want to achieve…

Vector2 vec2 = new Vector3(1,1,1) + new Vector2(1,1);  //returns (2,2), truncating the z element

I’m sick of continuously casting Vector2’s and Vector3’s when working with Unity’s 2d feature. Thanks!

Yes this is very possible, take a look here.

I’ve never used it on a Vector3, but I can’t think of something why it wont work, and if so, you can still create your own struct instead of overwriting it!

Hope it helps somehow

Might be able to achieve the same effect by writing Vector3 addWide(Vector3 v3, Vector2 v2) … .