public Coord GetCoord()
    {
        if (!snap)
        {
            SetSnap();
        }
        Vector2 gridPos = snap.gridSideLength == 0 ? Vector2.zero : (Vector2)snap.GetGridPosition() / snap.gridSideLength;
        Coord   coord   = new Coord((int)gridPos.y, (int)gridPos.x);

        return(coord);
    }
Example #2
0
    public Coord GetCoord()
    {
        if (!snap)
        {
            snap = GetComponent <ZST_SnapToGrid>();
        }
        Vector2 gridPos = snap.gridSideLength == 0 ? Vector2.zero : (Vector2)snap.GetGridPosition() / snap.gridSideLength;
        Coord   coord   = new Coord((int)gridPos.y, (int)gridPos.x);

        return(coord);
    }