- Home /
Long string for dialog text
I use dictionaries to store text for dialogs. But if string is big, it is uncomfortable to work with it. What is the better way to solve it?
Answer by Oribow · Apr 10, 2016 at 05:11 PM
For this use case Unity has TextAssets.
TextAsset textAsset;
void Start () {
string theText = textAsset.text; //Get the text from the asset
}
Just create a TextAsset and assign it in the editor.
What Oribow said. This will also make it easier to localize your app for other languages, as you can just load a different text asset for each language you want to support.
Also, consider storing your dialog using key value pairs ins$$anonymous$$d of just indexing by number. This will make it easier to logically relate the two.
Your answer
Follow this Question
Related Questions
Need help in typing project 0 Answers
Display Hit Text On Collition 1 Answer
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
One Unity instance writes to a text file, while the other reads the text file 1 Answer