如何加载资产包

How Do I Load A Assets Bundle

所以我创建了这个对象,它应该在我触摸游戏对象时在屏幕上加载游戏。但是,当我 运行 它时,我得到这个 运行 时间错误

Scene 'A' (-1) couldn't be loaded because it has not been added to the build settings or the asset bundle has not been loaded. To add a scene to the build settings use the menu File->Build Settings... UnityEngine.Application:LoadLevel(String) NewBehaviourScript:OnCollisionEnter(Collision) (at Assets/NewBehaviourScript.cs:10)

这是我的代码:

using UnityEngine;
using System.Collections;

public class NewBehaviourScript : MonoBehaviour
{
    void OnCollisionEnter (Collision col)
    {
        if(col.gameObject.name =="Hurt") 
        {
            Application.LoadLevel("A");
        }
    }
} 

这意味着构建设置中缺少您的场景。

转到“文件”->“构建设置”,然后您会得到一个 window,您需要拖放所有需要的场景。

与 Asset Bundle 无关。