Skip to content

Instantly share code, notes, and snippets.

@unitycoder
Created February 22, 2015 16:52
Show Gist options
  • Select an option

  • Save unitycoder/367a900a185fc9361db4 to your computer and use it in GitHub Desktop.

Select an option

Save unitycoder/367a900a185fc9361db4 to your computer and use it in GitHub Desktop.

Revisions

  1. unitycoder created this gist Feb 22, 2015.
    32 changes: 32 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,32 @@
    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;
    }

    }