- 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.
- Python入門很簡單
- MySQL 8 DBA基礎(chǔ)教程
- Mastering Articulate Storyline
- Apache Hive Essentials
- 從程序員到架構(gòu)師:大數(shù)據(jù)量、緩存、高并發(fā)、微服務(wù)、多團(tuán)隊協(xié)同等核心場景實戰(zhàn)
- Django Design Patterns and Best Practices
- Django:Web Development with Python
- 零基礎(chǔ)學(xué)Python網(wǎng)絡(luò)爬蟲案例實戰(zhàn)全流程詳解(高級進(jìn)階篇)
- Python數(shù)據(jù)分析從0到1
- 深入理解Android:Wi-Fi、NFC和GPS卷
- 區(qū)塊鏈技術(shù)進(jìn)階與實戰(zhàn)(第2版)
- Learning iOS Security
- Appcelerator Titanium:Patterns and Best Practices
- Machine Learning for OpenCV
- Pandas 1.x Cookbook