So there’s this thing I whant to code tried multiple time and either it does work or unity freeze when I play test it.
I created an array of input field and I whant to call a method inside the Update only of all the array are not focused. If one element of the array is focused I do t what the method to work/be call.
also I romeved both script and turned the bool on and off on the editor and I saw that this worked. I just can’t figured of to turn it on and off via script.
it seem so simple but I can’t seem to find the solution.
since I’m a noob I have a question. is it good that the script that check for the array is a different script, or should I put that piece of script in the same scrip where my method is??
Both work, ultimately it comes down to preference for organization, making a structure that is clear to you. I prefer a big main script that does almost everything, and other scripts refer to it as needed. But connections between scripts can be done in all sorts of ways, and large scripts can get unwieldy, so there are tradeoffs. Making things modular is usually a good idea, but that can also go too far, where you have tons of functions or scripts that each do very little.