I’m currently using static boolean variables to trigger functions from another script.
Basically the other script would have an if statement in Update(), constantly checking the value of that boolean.
Also in one of my scripts, the if statement is checking up to 7 booleans simultaneously every frame.
Do you think it’s unnecessary CPU usage?
Using GetComponent<> has apparently performance overhead and since I’m making a mobile game, I want to save up every CPU resource I can.
Do you think using these static boolean variables are a good thing performance-wise, or should I use other means such as GetComponent or SendMessage?
Now FindObjectsOfType() is a function to be carefull with, use it in Awake and Start functions to initialize a variable with it (like a reference to another scipt).
Also using the Update() functions should be avoided as much as possible if you can do it another way.