Skip to content

Instantly share code, notes, and snippets.

@unitycoder
Created February 22, 2015 16:52
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save unitycoder/367a900a185fc9361db4 to your computer and use it in GitHub Desktop.
Save unitycoder/367a900a185fc9361db4 to your computer and use it in GitHub Desktop.
Vector2i with ToString
using System;
public struct Vector2i
{
private int X;
private int Y;
private int x
{
set { X = value; }
get { return X; }
}
private int y
{
set { Y = value; }
get { return Y; }
}
public Vector2i(int x, int z)
{
this.X = x;
this.Y = z;
}
// for using Debug.Log(myVector2i.ToString()); : http://stackoverflow.com/questions/11726225/how-to-display-the-fields-of-a-struct
public override string ToString()
{
return this.X+","+this.Y;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment