Variable scope - determining where a variable can be used
Variable scope is a fancy way of saying, "Where in the script a variable exists." The following screenshot explains the scope of some variables:

You might have noticed that the rectangular blocks start and end with curly brackets. Just like the AddTwoNumbers()
method in Chapter 2, Introducing the Building Blocks for Unity Scripts, the code between an opening curly bracket and a closing curly bracket is called a code block. Absolutely wherever in a code you have an opening curly bracket, there will be a closing curly bracket to match. All of the code between the two brackets is a code block. Notice that code blocks can be nested inside other code blocks.
Note
You normally won't create bare blocks of code with curly brackets like I did in the case of Code Block 3. Code blocks usually include other things, such as if
statements, looping statements, and methods. This example is just to demonstrate how the scope of a variable works and where...