I was making an word puzzle game just like book worm, i have 16 text UI element on my hierarchy and each of one has script on it that responsible for setting the value.
I tried to setting up manually the letters of the answers, like for example the answer is "sample" every char i put it on every text ui
void Start()
{
Assign = this.GetComponent<Text>();
split = getAnswer().ToCharArray();
if (Ans) {
Assign.text = split[randAns()].ToString().ToUpper();
}
else if (isStatic) {
Assign.text = Assign.text;
}
else {
Assign.text = listLetters[randLetters()].ToUpper();
}
}
My code is on manual, i have bool of "Ans" if its true the letters will be assign on the text ui will be get in the letter from the answer, if the "isStatic" is true letter will be set will come from random letters from a to z. My question is how can i make it dynamic it will automatically set the letters from answer without repeating each letter.