using UnityEngine;
using System.Collections;
using UnityEditor;
using System.IO; public class ChangeName : MonoBehaviour { // public string versionDir;
// public string abName; void Start ()
{
for(int i = ;i< ;i++)
{
string path = "RES/com/face/prefab/0_"+i;
string abname = "face0_" + i;
SetVersionDirAssetName (path,abname);
}
} public void SetVersionDirAssetName(string versionDir,string abName)
{
var fullPath = Application.dataPath + "/" + versionDir + "/";
var relativeLen = versionDir.Length + ; // Assets 长度
if (Directory.Exists(fullPath))
{
EditorUtility.DisplayProgressBar("设置AssetName名称", "正在设置AssetName名称中...", 0f);
var dir = new DirectoryInfo(fullPath);
var files = dir.GetFiles("*", SearchOption.AllDirectories);
for (var i = ; i < files.Length; ++i)
{
var fileInfo = files[i];
EditorUtility.DisplayProgressBar("设置AssetName名称", "正在设置AssetName名称中...", 1f * i / files.Length);
if (!fileInfo.Name.EndsWith(".meta"))
{
var basePath = fileInfo.FullName.Substring(fullPath.Length - relativeLen).Replace('\\', '/');
var importer = AssetImporter.GetAtPath(basePath);
if (importer && importer.assetBundleName != versionDir)
{
importer.assetBundleName = abName;
}
}
}
EditorUtility.ClearProgressBar();
}
}
}

批量设置AssetBundleName的更多相关文章

  1. js 批量设置css样式

    在js中更换样式比较常见,但是批量设置比较少遇见: 但是在做就是插件时,不想额外的添加css文件(需要导入,还可能引起冲突),能批量设置就比较方便了. 以下代码是来自网上的三种方法,使用第二种最方便了 ...

  2. powershell批量设置权限

    批量设置权限 $acl=get-acl .\demo Get-ChildItem .\Documents -Recurse -Force|Set-Acl -AclObject $acl

  3. [转]android:动态创建多个按钮 及 批量设置监听

    之前投机取巧,先创建好多个按钮,再根据需要的数量进行部分隐藏,不过还是逃不过呀. 这样根本无法批量地 findId,批量地 设置监听. 所以今天还是认认真真地研究回“动态创建按钮”,终于,通过不断尝试 ...

  4. Azure PowerShell (7) 使用CSV文件批量设置Virtual Machine Endpoint

    <Windows Azure Platform 系列文章目录> 请注意: - Azure不支持增加Endpoint Range - 最多可以增加Endpoint数量为150 http:// ...

  5. java classpath批量设置shell脚本

    java classpath批量设置shell脚本   注意:linux bash jar文件之间的分隔符是':'    export JAR_HOME=path to directory which ...

  6. WinForm 批量设置指定控件中的控件状态

    在开发中常遇到当点击某个按钮的时候,禁用文本框或按钮的的状态,以防止误操作,下面的代码是我已批量设置指定控件中的按钮状态的代码,同理可以延伸出很多操作. /// <summary> /// ...

  7. ssh免密验证,shell批量设置

    ssh免密验证,shell批量设置 #ssh免密验证,shell自动设置 echo '#!/bin/sh . /etc/init.d/functions [[ -f /usr/bin/expect ] ...

  8. ArcGIS AddIn 批量设置栅格图层背景色为透明

    protected override void OnClick() { // // TODO: Sample code showing how to access button host // Arc ...

  9. 【MM系列】SAP里批量设置采购信息记录删除标记

    公众号:SAP Technical 本文作者:matinal 原文出处:http://www.cnblogs.com/SAPmatinal/ 原文链接:[MM系列]SAP里批量设置采购信息记录删除标记 ...

随机推荐

  1. 湖南省第六届大学生程序设计大赛原题 F Biggest Number (UVA1182)

    Biggest Number http://acm.hust.edu.cn/vjudge/contest/view.action?cid=30851#problem/F 解题思路:DFS(检索)+BF ...

  2. HTML 5 视频使用

    视频格式 当前,video 元素支持三种视频格式: 格式 IE Firefox Opera Chrome Safari Ogg No 3.5+ 10.5+ 5.0+ No MPEG 4 9.0+ No ...

  3. Nginx的启动脚本

    vi /etc/init.d/nginx #!/bin/sh # nginx        Startup script for nginx # chkconfig: - 85 15 # proces ...

  4. ncsim仿真VHDL

    ncsim仿真VHDL 1.文件列表 ctrl.vhd design_io.vhd tb.vhd compile.nc simulate.nc ./shm/shmtb.tcl 2. Compile你的 ...

  5. keepalived vip漂移基本原理及选举算法

    keepalived可以将多个无状态的单点通过虚拟IP(以下称为VIP)漂移的方式搭建成一个高可用服务,常用组合比如 keepalived+nginx,lvs,haproxy和memcached等.它 ...

  6. .NET基础拾遗(4)委托为何而生?

    生活中的例子: 你早上要吃包子作为早饭,那么你可能让你爸爸或者妈妈帮你做,那你就会调用 爸爸.要包子() 或妈妈.要包子() 返回包子对象. 但是如果你爸妈不在家的时候,你只能去街上买,问题是你根本不 ...

  7. asp.net实现将网页存为mht格式文件,类似于网页另存为mht功能

    MHT 首先说一下什么是mht格式文件,MHT叫“web单一文件”,就是把网页中包含的图片,CSS文件以及HTML文件全部放到一个MHT文件里面,而且浏览器可以直接读取显示.可以通过ie浏览器将一个网 ...

  8. Rect

    判断给定的点是否被一个CGRect包含,可以用CGRectContainsPoint函数   BOOL contains = CGRectContainsPoint(CGRect rect, CGPo ...

  9. irms模拟数据生成及数据分析

    一.数据准备 1.每天生成随机一个文本,每小时向文本中追加2次数据,每次10万条 随机数据生成: 2,32  * * * *  bash /mnt/jediael/irms/signalGenerat ...

  10. angularjs:[1] ui-router 权限控制

    1:简单的登录检查 $stateProvider .state('index', { url: "/", templateUrl: 'views/forwards/intro.ht ...