Created
February 22, 2015 16:52
-
-
Save unitycoder/367a900a185fc9361db4 to your computer and use it in GitHub Desktop.
Vector2i with ToString
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
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