- Learning C# by Developing Games with Unity 3D Beginner's Guide
- Terry Norton
- 183字
- 2021-08-04 10:04:00
Writing C# statements properly
When you do normal writing, it's in the form of a sentence with a period used to end the sentence. When you write a line of code, it's called a statement with a semi-colon used to end the statement.
Note
The reason a statement ends with a semi-colon is so that Unity knows when the statement ends. A period can't be used because they are used in the Dot Syntax.
The code for a C# statement does not have to be on a single line as shown in the following example:
public int number1 = 2;
The statement can be on several lines. Whitespace and carriage returns are ignored, so if you really want to, you can write it as follows:
public int number1 = 2;
But I recommend you to not write your code like this because it's terrible reading code formatted like the preceding code. However, there will be times that you'll have to write long statements that will be longer than one line. Unity won't care. It just needs to see the semi-colon at the end.
- 小程序實戰視頻課:微信小程序開發全案精講
- 自己動手實現Lua:虛擬機、編譯器和標準庫
- MySQL 8從入門到精通(視頻教學版)
- Podman實戰
- The Data Visualization Workshop
- Visual Basic學習手冊
- Python時間序列預測
- 全棧自動化測試實戰:基于TestNG、HttpClient、Selenium和Appium
- BIM概論及Revit精講
- 從Java到Web程序設計教程
- Nagios Core Administration Cookbook(Second Edition)
- 零基礎學HTML+CSS第2版
- 測試架構師修煉之道:從測試工程師到測試架構師
- PowerDesigner 16 從入門到精通
- 深度實踐KVM:核心技術、管理運維、性能優化與項目實施