1

Пытаюсь сделать игру на Android, при клике по кнопке для перехода на другую сцену выдает ошибку:

Scene '0211651' 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.Application:LoadLevel(String) Buttons:OnMouseUpAsButton() (at Assets/Scripts/Buttons.cs:11) UnityEngine.SendMouseEvents:DoSendMouseEvents(Int32)

Код для перехода (C#):

using UnityEngine;
using System.Collections;

public class Buttons : MonoBehaviour {
    private void OnMouseUpAsButton() {
        switch (gameObject.name) {
            case "Play":
                Application.LoadLevel("0211651");
                break;
        }
    }
}

Может ли это быть из-за того, что сцены делал не в одном проекте, а в двух, а потом уже импортировал из одного в другой?

1 ответ 1

2

Возможно проблема в том, что вы не добавили сцену в сборку. Чтобы это сделать нужно поставить галочку напротив нужной сцены в Build Settings

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.