Say I have a character object and several scripts that interact with it, is it better practice to have a member variable on each of these scripts that references the character object, or one global variable that they can all reference? I am developing for iOS.
I suspect there’s no appreciable speed difference in this case. I don’t know the exact implementation of globals (static public) in .Net, but in non-interpreted languages the difference would be essentially zero. On the other hand, a global variable would probably use less resources