tzutzu858 / jump

查克尋找威爾森的jump小遊戲
0 stars 0 forks source link

場景切換比較 #3

Open tzutzu858 opened 4 years ago

tzutzu858 commented 4 years ago

unity


SceneManager.LoadScene("要切換的場景名稱");


Android studio


startActivity(new Intent(現在的Activity名稱.this,要切換的Activity名稱.class));
finish();
tzutzu858 commented 4 years ago

錯誤訊息: couldn't be loaded because it has not been added to the build settings or the AssetBundle has not been loaded. To add a scene to the build settings use the menu File->Build Settings... UnityEngine.SceneManagement.SceneManager:LoadScene(String) ClearDirector:Update() (at Assets/ClearDirector.cs:12)

原因:因為場景沒被註冊 所以要先註冊 「場景的使用順序」

File/Build Settings/把所有場景拖拉到Scenes In Build欄 這個動作很像Android studio在manifest多加activity,但忘記當時的錯誤訊息是什麼了

tzutzu858 commented 4 years ago

裝置間的速度差異

高性能PC一秒可以呼叫60次Update方法 而性能較低的手機可能一秒只能呼叫20次Update方法

假設Update設定讓角色往右移動「x=1」 PC一秒可以到達「x=60」的位置 而手機可能只能到達「x=20」的位置

裝置間的差異,可以使用Time.deltaTime設定一秒後的移動地點來解決問題