private void GridLineX() { //x軸のグリッド線を生成 for (int i = 0; i < 19; i++) { GameObject go = Instantiate(gridLine); GridLines grid = go.GetComponent <GridLines>(); go.transform.parent = Camera.main.transform; go.transform.localPosition = pos; go.name = "GridLine"; grid.GridLineX(pos.x); pos.x += interval; } }