I want to check if a bool function is true or false, but I wanna avoid the Update function. I’ve looked into properties but I could only find stuff for bool variables not bool functions. There becomes the problem of assigning Win() = value; in the property that doesn’t work since it’s a method, maybe there is a trick to it, any help is appreciated.
bool Win()
{
foreach (GameObject letter in wordUI.playerLetters)
{
if (!letter.GetComponentInChildren<TextMeshProUGUI>().enabled) return false;
}
return true;
}
Currently checking constantly in the Update function works but I know it’s a terrible idea.
void Update()
{
if (Win()) currentState = State.WIN;
}