Hi all again,
I am having some puzzling issue with a If-statement within a For-loop. In brief, the script is supposed to, in the beginning, read a txt file into an array, and subsequently the If-statement-within-For-loop will identify the exact text needed and returns the value.
The txt file, named Language.txt, goes like this:
The script that I crafted goes like this:
Up till the part for the loop, the script has no problem, as if I insert a print(j) before the if-statement, all the j values (from 0 to 3) were returned in the debug console. And if I do print(Languages[j]) before (or after) the If-statement, all the Languages[j] are also returned. The one that is not working is the if-statement. Somehow it is not being activated (for lack of a better word).
I have look thru a number of questions/answers here in UnityAnswer, and it seems the script above is not too different from some of these questions/answers (e.g. like this, and theirs are working.). Am I missing something here?
Thanks in advance!
my guess is that your split function is leaving some white space characters before or after each element of Languages.
if it doesnt work let us know what it prints
answered Feb 25 '11 at 10:07 AM