Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

場景切換比較 #3

Open
tzutzu858 opened this issue Apr 10, 2020 · 2 comments
Open

場景切換比較 #3

tzutzu858 opened this issue Apr 10, 2020 · 2 comments

Comments

@tzutzu858
Copy link
Owner

tzutzu858 commented Apr 10, 2020

unity

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

Android studio

startActivity(new Intent(現在的Activity名稱.this,要切換的Activity名稱.class));
finish();
@tzutzu858
Copy link
Owner Author

tzutzu858 commented Apr 10, 2020

錯誤訊息:
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
Copy link
Owner Author

裝置間的速度差異

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

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant