当前位置:网站首页>Unity makes AB package

Unity makes AB package

2022-07-06 20:13:00 LiPing122335

(1) Create what we need asset bundle The name of the resource package , Click any resource , new One asset bundle Name ;

(2) Will you break into asset bundle Resources in the resource bag , Specify the name we just created ;

(3) Expand our editor , Call the editor API function , Come and take us asset bundle Pack it ;

using System.Collections;
using System.Collections.Generic;
using System.IO;
using UnityEditor;
using UnityEngine;

public class TextAB : MonoBehaviour {
    [MenuItem("ChaJian/AB")]
    public static void Get()
    {
        string path = Application.streamingAssetsPath;
        //
        if (!Directory.Exists (path))
        {
            Directory.CreateDirectory(path);// Create folder

        }
        BuildPipeline.BuildAssetBundles(path, BuildAssetBundleOptions.None, BuildTarget.StandaloneWindows64);
    }
    
}

// Script Asset Of Editor

原网站

版权声明
本文为[LiPing122335]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202131232206024.html