|
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:
Can anyone help me out with this?
(comments are locked)
|
|
Place your text file into Unity's assets folder. Then make the script changes below, and drag a reference to the text asset into the "dataFile" variable below.
That should do it! (untested though... give me a shout in the comments if it doesn't work!)
(comments are locked)
|
