- Learning C# by Developing Games with Unity 5.x(Second Edition)
- Greg Lukosek
- 140字
- 2021-07-09 20:03:35
Where you declare a variable is important
You will be declaring and using variables in many places in a script. The variables that I have shown you so far are called member variables. They are members of the LearningScript
class—not declared within any method. These member variables are the only variables that have the option of being displayed in the Inspector panel or being accessed by other scripts.
Note
Declaring your member variables at the beginning of a class may give you a mental clue that these member variables can be used anywhere in the script.
We will also be creating variables in methods. These variables are called local variables. They are never displayed in the Unity's Inspector panel, nor can they be accessed by other scripts. This brings us to another concept of programming, called variable scope.
- Visual Basic 6.0程序設計計算機組裝與維修
- Raspberry Pi Networking Cookbook(Second Edition)
- jQuery EasyUI網站開發實戰
- 用Flutter極速構建原生應用
- Apex Design Patterns
- R Deep Learning Cookbook
- BIM概論及Revit精講
- Extending Puppet(Second Edition)
- Learning AWS
- Regression Analysis with Python
- Android應用開發深入學習實錄
- Kubernetes進階實戰
- Android技術內幕(系統卷)
- Tkinter GUI Programming by Example
- C#程序設計基礎與實踐