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 braces. Just like the AddTwoNumbers()
method in Chapter 2, Introducing the Building Blocks for Unity Scripts, the code between an opening curly brace and a closing curly brace is called a code block. Absolutely wherever in a code you have an opening curly brace, there will be a closing curly brace to match. All of the code between the two braces 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 braces 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 a variable...