Hello, I need to be pointed in the right direction with Unity's TextAsset component.
I will have a .txt file with 400 numbers, without spaces. ex: "010100111000101010" I want to have unity read each indivdual character, if it detects a "0" it will move up a value(position) and if it detects a "1", it will add a prefab (in this case a cube) before moving up a value. The end result will be a 20x20 grid of blocks in pre-determined positions.
I want to integrate it into this script somehow:
var cube : Transform;
function Start () {
for (var y = 0; y < 5; y++) {
for (var x = 0; x < 5; x++) {
var cube = Instantiate(cube, Vector3 (x, y, 0), Quaternion.identity);
}
}
}
Can anyone help me out with this?