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.