Unity加载AB资源

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class AssetBundleLoad : MonoBehaviour {

    void Start () {

        AssetBundle ab = AssetBundle.LoadFromFile(Application.dataPath + "/StreamingAssets/player1.ab");

        GameObject player = ab.LoadAsset("Necromancer");

        GameObject.Instantiate(player, Vector3.zero, Quaternion.identity);
    }
}

 

你可能感兴趣的:(Unity加载AB资源)