Static Type — what is it?

Al Heck
Aug 19, 2021

Static information is “stuck” information held for the life of the program. In this program, there are 2 scripts — a script where if I press the space bar, I add 10 to score and I have a score manager that has the score value attached to it.

We can turn that data static — it will remain for the life of the program.

Because I set the variable to static, I no longer need to do a get component — it’s available for the life of the program so I can treat it like a class.

If you want to see the value, just add a debug.log.

--

--

Al Heck

Unity Developer and Software Engineer who loves making games with GameDevHQ