}
private void SetAllPaths()
{
//左上角
for (int i = 0; i < rowNum ; i++)
{
for (int j = 0; j < columnNum ; j++)
{
if (Movable(new Vector2(i, j)))
ChangePath(new Vector2(i, j));
if (Movable(new Vector2(j, i)))
ChangePath(new Vector2(j, i));
}
}
//左下角
for (int i = 0; i < rowNum ; i++)
{
for (int j = 0; j < columnNum ; j++)
{
if(Movable (new Vector2 (i,rowNum -1-j)))
ChangePath (new Vector2 (i,rowNum -1-j));
if(Movable (new Vector2 (columnNum -1-j,i)))
ChangePath (new Vector2 (columnNum -1-j,i));
}
}
//右上角
for (int i = 0; i < rowNum; i++)
{
for (int j = 0; j < columnNum; j++)
{
if (Movable(new Vector2(i, rowNum - 1 - j)))
ChangePath(new Vector2(i, rowNum - 1 - j));
if (Movable(new Vector2(j, columnNum - 1 - i)))
ChangePath(new Vector2(j, columnNum - 1 - i));
}
}
//右下角
for (int i = 0; i < rowNum; i++)
{
for (int j = 0; j < columnNum; j++)
{
if (Movable(new Vector2(rowNum - 1 - i, rowNum - 1 - j)))
ChangePath(new Vector2(rowNum - 1 - i, rowNum - 1 - j));
if (Movable(new Vector2(columnNum - 1 - j, columnNum - 1 - i)))
ChangePath(new Vector2(columnNum - 1 - j, columnNum - 1 - i));
}
}
}