Unity 新手— Day 02

if
你也許已經知道了
if( 繼續把文章看完){ ( 你就會知道怎麼用if )}

Debug.Log(“(你要說的話)”);
Unity 中 有console會顯示出編譯的成果(console面板),此指令會讓他跑出訊息


Time.time


每一幀的時間資訊都會顯示出來。
什麼是幀數?
小秘訣 //
- 選擇一個區塊,按shift + " 就會直接將它套入" "中。
- 將cs檔拖曳到物件上,點兩下就可以進入VS Code。

GetComponent<MeshRenderer>().enabled = false
當物件被觸發會消失!

GetComponent<MeshRenderer>.()enabled
When the game starts, the object disappeared right away.
Above are the same core with different scripting.


rigidBody

當我上課時,畫面是較舊的版本,宣稱方式是RigidBody。
現在最新版本2021,則是rigidBody。
隨時注意大小寫的變化,差一點就差很多!
英文版教學文章
https://medium.com/@MonlesYen/unity-beginner-day-02-f364d697d796