public static string[] FindAssets (string filter); public static string[] FindAssets (string filter, string[] searchInFolders); 参数 filter 筛选器字符串可以包含搜索数据。有关此字符串的详细信息,请参阅下文。 searchInFolders 要从中开始搜索的文件夹。 返回 string[] 匹配资源的数组。请注意将返回 ...
FindAssets() //查找资源,有两个重载函数 public static string[] FindAssets(string filter); public static string[] FindAssets(string filter, string[] searchInFolders); 例子:获取指定目录下所有prefab路径的两种方式 //第一种,用Unity的接口 List<string> files = AssetDatabase.FindAssets("t:Prefab", ...
void FindDependcy(string targetPath, string filter = "", string searchInFolders = "") { string[] searchObjs; if (!string.IsNullOrEmpty(searchInFolders)) { string[] folders = m_TargetPath.Split(','); searchObjs = AssetDatabase.FindAssets(filter, folders);//获取需要查找引用的对象 } else {...
voidFindDependcy(stringtargetPath,stringfilter ="",stringsearchInFolders ="") { string[] searchObjs; if(!string.IsNullOrEmpty(searchInFolders)) { string[] folders = m_TargetPath.Split(','); searchObjs = AssetDatabase.FindAssets(filter, folders);//获取需要查找引用的对象 } else { searchObjs =...
AssetDatabase-FindAssets filter中可以包括名称、标签或者类型(类名称) Name: 名称通过空格隔开当成一个独立的名字来搜索。比如"Texture Player",隔开的字段可以用来筛选,Texture和Player都可以进行查找 Labels:Assets可以通过labels附加来进行查找,Assets可以通过关键字'l:'加一个label来进行查找。 Types:在资源类型前加关...
54staticstringfilterLabel ="l:lgs";5556staticstringfilterMixed ="Cube l:lgs";//混合过滤---名字中有Cube,Label为 lgs5758[MenuItem("Tools/Find Asset")]59staticvoidFindAsset()60{61string[] guidArray =AssetDatabase.FindAssets(filterMixed);62foreach(stringiteminguidArray)63{64Debug.Log(AssetData...
[j].name); } } } } public override void OnSelectPath(string path, bool isPath) { if (isPath) { m_AssetList = new List(); path = path.Replace(Application.dataPath, "Assets"); string[] assets = AssetDatabase.FindAssets(m_AssetFilter, new string[] { path }); if (assets != ...
要优化包体大小,就要清楚知道包里到底有哪些资源,资源在打成bundle后到底有没有冗余,通过AssetStudio可以查看包里具体的资源,打开我们打好的bundle所在文件夹,根据Filter Type选项过滤只留Shader类型资源并大小排序,不看不知道,一看吓一跳,内置Standard shader冗余了有两百多个,按每个701900b算总共占据了100M多包体大小...
16.TypeFilter: 对基础过滤,显示需要(子类)的属性 17.TypeInfoBox:类型信息框属性 18.AssetsOnly\SceneObjectsOnly:引用限制为预制体\场景物体 19.ValidateInput:输入验证 20.ValueDropdown 用于任何属性,并创建一个带有可配置选项的下拉列表。 四.总结 五:相关链接 一.开发环境 以下为本人测试时环境: VS版本: 201...
FindAssetsSearch the asset database using the search filter string. ForceReserializeAssetsForcibly load and re-serialize the given assets, flushing any outstanding data changes to disk. ForceToDesiredWorkerCountForces the Editor to use the desired amount of worker processes. Unity will either spawn ne...