Unityでトップ画面からゲーム画面へ遷移させようとした時に下記のようなエラーが発生してしまいました。
Scene 'GameScene' 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:LoadSceneAsync(String)
今回はこのエラーの対処法についてのメモです。
build settings or the AssetBundle has not been loaded.の対処法
エラーは、「Sceneがbuild settingsに追加されていない場合」に発生するエラーです。
このエラーの対処法はエラー内容に書いてある通り、
To add a scene to the build settings use the menu File->Build Settings...
Build Settingsで遷移先のSceneを追加すれば解決できます。
Unityでプロジェクトを作成すると、最初のSceneは初めからBuildSettingsに追加されているため、普通にビルドできますが、他のSceneに切り替えたい場合は、BuildSettingsで遷移先のSceneを追加しないと上記のようなエラーが出るようです。