Unity自定义打包配置

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

[CreateAssetMenu(fileName ="ABconfig",menuName ="CreateABconfig",order =0)]
public class ABConfig : ScriptableObject
{
    public List m_AllPerFabPath = new List();
    public List m_AllFile=new List();

    [System.Serializable]
    public struct FileDirABName
    {
        public string ABName;
        public string Path;

    }
}

进行打包

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

public class NewBehaviourScript : MonoBehaviour
{
    public static string ABCONFIGPATH = "Assets/Editor/ABConfig.asset";
    [MenuItem("Tools/打包")]
    public static void Build()
    {
        ABConfig config = AssetDatabase.LoadAssetAtPath(ABCONFIGPATH);
        foreach(string str in config.m_AllPerFabPath)
        { 
            print(str);
        }
        foreach(ABConfig.FileDirABName file in config.m_AllFile)
        {
            print(file.ABName);
        }

    }
}

你可能感兴趣的:(unity,unity,游戏引擎)