January 2015
Intermediate to advanced
380 pages
8h 32m
English
Throughout all examples so far, we've considered text directly stored in string objects, but you can also work with text files in Unity. Specifically, you can load in text from external sources. Here, I will demonstrate how.
The first method is to drag-and-drop a text file into a Unity project that imports the text asset. The file is imported as a TextAssets type, as shown here:

Importing text files into Unity as TextAssets
You can access the file and its text data from any script file by exposing a TextAsset public member, as shown in the following code sample 6-25:
//-------------------------------------------------- ...
Read now
Unlock full access