Variables (C# and Unity)

In a previous article, we talked about the importance of avoiding magic numbers with variables and constants. Today we will dig deeper into variables how to use them. Before we dig in, it is important to understand that a philosophical debate about variables has been waged for years between purists and practical programmers. This article will not address those topics and instead will focus on how and when I use them. Also of importance is that the use of the term Global here is referring to a class-level variable.

Global (Class) vs Local

--

--

Turning my passion for video games and 11 years of software development experience into a focus on video game development using Unity3D.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
James West

Turning my passion for video games and 11 years of software development experience into a focus on video game development using Unity3D.