sisterofDC / kotlin_system_study

kotlin_system_study
0 stars 0 forks source link

android in unity #1

Open sisterofDC opened 2 years ago

sisterofDC commented 2 years ago

創建項目後先看下有沒有關聯到vs 返回默認佈局在上面layout

右鍵然後wasd,可以移動 右鍵EQ可以上下移動

sisterofDC commented 2 years ago

物體可以進行繼承 繼承後,坐標是相對與父類的,所以如果計算子類的坐標,加上父類的坐標

sisterofDC commented 2 years ago

左邊的所以的含義 右上角有reset,如果設置錯誤可以用這個 前面有打光,這裡可以查一下unity 中打光的作用 c# 的語法可以查一下,首先需要打分號

sisterofDC commented 2 years ago

在c#中變量要下劃線 在unity中也有lifecycle函數這裡對比一下,在android 中也有Lifecycle函數

https://developer.android.com/guide/components/images/activity_lifecycle.png 比如在android 中 [onCreate()] [onStart()] [onResume()] [onPause()] [onStop()] [onDestroy()]。当 Activity 进入新状态时,系统会调用其中每个回调。

在unity 中 https://docs.unity3d.com/uploads/Main/monobehaviour_flowchart.svg 這裡是unity中的生命週期

初始化 awake onenable reset start

物理加載 fixedupdate 事件加載遊戲邏輯 update lateupdate

暫停和結束 Onapplicationpause onapplicationQuit onDestroy

sisterofDC commented 2 years ago

在unity中如果調用同一個文件,應該沒有問題。這裡實驗一下

sisterofDC commented 2 years ago

在vs中用完後需要保存,然後unity才會生效