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.