Hi
I want to read an existing (x,y,z,var) data file into an array at start up. I have imported it as a Text Asset already. I’ve tried exposing a TextAsset type of variable in the script that I want to read it with but can’t drop my Text Asset onto that.
Any pointers gratefully received.
Thanks
Dave
The text asset has some kind of extension that allows it to be read as text? (Usually “.txt”.) Because if not it will behave as you describe.
–Eric
Thanks for advice. Working now.
Got my text in, split it up nicely, got it into the arrays I want but can’t convert my text strings into numbers and none of the usual JS conversion tricks work.
I’m sure this is something simple but can;t find it anywhere.
Help much appreciated as ever.
Try:
var myInt = System.Convert.ToInt32("123");
Cheers,
-Jon
That’s fantastic Jon - thanks.
Is there a similar fix for non integers?
Sorry = got it - toDecimal or toDouble