赞
踩
首先提供官方参考文档:API-Reference-AssetImporter
概述: 命名空间为UnityEditor;
属性
静态方法
公有方法
- [MenuItem("AssetBundle/Set AssetBundle Name")]
- public static void SetAssetbundleName() {
- Object[] selects = Selection.objects;
-
- foreach (Object selected in selects) {
- string path = AssetDatabase.GetAssetPath(selected);
-
- AssetImporter assetImporter = AssetImporter.GetAtPath(path);
- assetImporter.assetBundleName = selected.name;
- assetImporter.assetBundleVariant = "unity3d";
- //assetImporter.SaveAndReimport();
- }
- //AssetDatabase.Refresh();
- }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。