This code block is activated on the press of a UI button:
// assign text
item = tfQ1.text;
orderCost = tfQ2.text;
orderQuant = tfQ3.text;
// check if textfields are blank
if (item.Trim() == "" | orderCost.Trim() == "" | orderQuant.Trim() == "")
{
objBlankErrorMenu.SetActive(true);
}
The tfq1/2/3 variables are GameObject.text objects that are assigned in the inspector.
I want an empty gameobject containing an error UI menu to open if any of the three textfields are attempted to be saved as blank. I can’t figure out why this wont work. Any ideas would be greatly appreciated!