- Home /
Reading Data generated in Processing from a TextAsset
I'm tearing my hair out over this problem. I'm generating a game state for my game in Processing by packing bytes and saving it to a text file. The game is tile based on a 2D board, so I'm saving a few bytes per tile to store the state.
I'm using a full byte(255) as a char to indicate the end of a line on a the board(so I'd move to the next line). I save the whole state out as text to a file.
Here's the problem -- When I read the file as a TextAsset in Unity using the .bytes member, I loop through it and I can't find any byte that is greater than 200 (which I should find many of for the end of the line bytes). When I write the end line byte as 254, Unity finds bytes that are set to 239... When I read the file back into processing, though, everything works perfectly.
Why is this happening? Is there any kind of limitation or difference that I don't know of with Unity, Mono / CSharp, TextAssets, anything?