Let’s say I had a “Game Manager” script as follows:
public class GM : MonoBehaviour
{
public static bool isPaused;
...blahblahblah
}
Then, for every instance object in my scene, I had this at the top of it’s update
void Update()
{
if (GM.isPaused)
return;
...All the rest of the code....
}
…In addition to that, of course I also set the timescale to 0f upon pausing.
My question is; Is there a substantial reason that using a public, static ‘GM.isPaused’ variable would be inferior to using a non-static, instance boolean variable? I don’t want anyone’s personal preference. I want to know, is there some sort of problem/consideration with doing this, however minor (such as lower performance), and how significant is the problem/consideration? You’d be helping me a lot.
Thanks!