using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
public class menuitem : Editor
{
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
public class menuitem : Editor
{
//菜单项
[MenuItem("create/click")]
static void A() {
[MenuItem("create/click")]
static void A() {
//选中的多个资源
GameObject[] games = Selection.gameObjects;
foreach (var item in games)
{
GameObject[] games = Selection.gameObjects;
foreach (var item in games)
{
//资源的路径
string path = AssetDatabase.GetAssetPath(item);
//通过路径获得资源
AssetImporter ai = AssetImporter.GetAtPath(path);
string path = AssetDatabase.GetAssetPath(item);
//通过路径获得资源
AssetImporter ai = AssetImporter.GetAtPath(path);
//ab包的名字
ai.assetBundleName = "cube";
}
//打包逻辑
BuildPipeline.BuildAssetBundles("Assets/AB",BuildAssetBundleOptions.None,BuildTarget.StandaloneWindows64);
}
}
ai.assetBundleName = "cube";
}
//打包逻辑
BuildPipeline.BuildAssetBundles("Assets/AB",BuildAssetBundleOptions.None,BuildTarget.StandaloneWindows64);
}
}