Skip to content

Instantly share code, notes, and snippets.

@Domiii
Created January 22, 2017 06:14
Show Gist options
  • Save Domiii/be108d602618b89cfbc177b75a5a39c9 to your computer and use it in GitHub Desktop.
Save Domiii/be108d602618b89cfbc177b75a5a39c9 to your computer and use it in GitHub Desktop.
[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