Skip to main content

45度角相同宽高的tile

生成地图的逻辑

    void InitMap()
{
float w, h = 0;
int index;
for (int x = 0; x < row; x++)
{
for (int y = 0; y < column; y++)
{
index = y % 2;
if (y % 2 == 1)
{
w = x + 0.5f;
h = y - (y * 0.5f); // 锁
}
else
{
w = x ;
h = y - (y * 0.5f); // louk
}

GameObject.Instantiate(outWallArray[index], new Vector3(w, h, 0), Quaternion.identity);
}
}
}