Can anybody help me out with giving the steps needed for reading data from the text file in unity and how can the script be added.
|
C# Version.
EDIT: (Fixed an error on line 9; changed "stm.ReadLine();" to "inp_stm.ReadLine();") |
||||
|
There's class named TextAssets which is used for text file read. http://docs.unity3d.com/Manual/class-TextAsset.html here you can find the supported file format. so if u want to read read the text file, script would be like this:
or you can read the text as resource like this:
|
|||||||||
|
You can do this in the same way you would in .NET
This code snippet can be used in any location you wish then. |
|||
|
This code is working fine for me to read the content in the text file
|
||||
|