Created
January 22, 2017 06:14
-
-
Save Domiii/be108d602618b89cfbc177b75a5a39c9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[System.Serializable] | |
public struct IntVector2 { | |
public int x, y; | |
public IntVector2 (int x, int y) { | |
this.x = x; | |
this.y = y; | |
} | |
public static IntVector2 operator + (IntVector2 a, IntVector2 b) { | |
a.x += b.x; | |
a.y += b.y; | |
return a; | |
} | |
public override string ToString () | |
{ | |
return string.Format ("({0}, {1})", x, y); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment