Skip to content

Instantly share code, notes, and snippets.

@aidiary
Last active October 11, 2018 00:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aidiary/76599268376397b661dc to your computer and use it in GitHub Desktop.
Save aidiary/76599268376397b661dc to your computer and use it in GitHub Desktop.
ブロックを積み上げて壁を作る
#pragma strict
// ブロック(インスペクタからセット)
var brickObject : GameObject;
function Start () {
// ブロックを配置して壁を作る
for (var y = 0; y < 10; y++) {
for (var x = -10; x < 10; x++) {
Instantiate(brickObject,
transform.position + Vector3(x, y, 0),
Quaternion.identity);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment