91焦先生

导航

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<GameObject>("Necromancer");

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

 

posted on 2019-04-14 16:06  91焦先生  阅读(1363)  评论(0编辑  收藏  举报