当前位置:网站首页>Unity addressable batch management
Unity addressable batch management
2022-06-25 08:26:00 【Teddy with one abdominal muscle】
Unity Use Addressable Achieve batch management
Recent project resource management uses Unity Resource addressing system AddressablesAsset, However, the amount of general resources in the project is small , So we are all dragging resources one by one Group in , And then modify address(Addressable Name)
Or in Prefab Of Inspector Modify on the panel 
But when there are too many resources , This method is too inefficient . Originally, I wanted to directly drag the entire folder to Group in , It turns out that the sub files in the folder , None of them Addressable Mark , And the resource cannot be found after packaging . in other words , Send the whole folder in , No hair , Or do you want to manage resources separately .
What to do in this situation , Find your own interface and write your own editor .
And then in UnityEditor Next , Find several interfaces .
[MenuItem("Tools/ add to Addressables")]
private static void AddAddressables()
{
string assetPath = "Assets/AssetBundleResources/Main/Cube.prefab";
string guid = AssetDatabase.AssetPathToGUID(assetPath);
AddressableAssetGroup group = AddressableAssetSettingsDefaultObject.Settings.FindGroup("Public");
AddressableAssetSettingsDefaultObject.Settings.CreateOrMoveEntry(guid, group);
AddressableAssetEntry addressableAssetEntry = AddressableAssetSettingsDefaultObject.Settings.FindAssetEntry(guid);
addressableAssetEntry.SetAddress("Cube.prefab");
Debug.Log(addressableAssetEntry.address);
//AddressableAssetSettingsDefaultObject.Settings.RemoveAssetEntry(guid);
}
This is the code I tested , This resource is added and deleted respectively , I used the original path Application.datapath+“/AssetBundleResources/Main/Cube.prefab", But I can't , Acquired GUID It's empty , I'll change it to "Assets/AssetBundleResources/Main/Cube.prefab", The normal , Subsequent extensions are not done , After a delay, you can traverse the sub files under the entire folder , Then add and delete the resources in the entire folder .
边栏推荐
- 想开个户,网上股票开户安不安全?
- Black dot = = white dot (MST)
- 2022年毕业生求职找工作青睐哪个行业?
- What are the indicators of DEA?
- Websocket understanding and application scenarios
- Bat start NET Core
- Use pytorch to build mobilenetv2 and learn and train based on migration
- How to calculate the fuzzy comprehensive evaluation index? How to calculate the four fuzzy operators?
- 初识生成对抗网络(12)——利用Pytorch搭建WGAN-GP生成手写数字
- Use Adobe Acrobat pro to resize PDF pages
猜你喜欢

A solution to slow startup of Anaconda navigator

InfluxDB时序数据库

First experience Amazon Neptune, a fully managed map database

C examples of using colordialog to change text color and fontdialog to change text font

Stm32cubemx learning (5) input capture experiment

Wechat applet opening customer service message function development

How to calculate the correlation coefficient and correlation degree in grey correlation analysis?

Overview of image super score: the past and present life of image super score in a single screen (with core code)

Stm32cubemx Learning (5) Input capture Experiment

企业全面云化的时代——云数据库的未来
随机推荐
软件确认测试有什么作用?确认测试报告的价格是多少?
Sword finger offer (simple level)
Log in to MySQL 5.7 under ubuntu18 and set the root password
Is there any risk in the security of new bonds
Set the textalign property of the label control in C to control the method of text centering
How to analyze the coupling coordination index?
VOCALOID notes
What is the difference between agreement and service?
Allgero reports an error: program has encoded a problem and must exit The design will be saved as a . SAV file
Scanpy (VII) spatial data analysis based on scanorama integrated scrna seq
图像超分综述:超长文一网打尽图像超分的前世今生 (附核心代码)
六月集训(第25天) —— 树状数组
A solution to slow startup of Anaconda navigator
Is there no risk in the security of new bonds
[red flag Cup] Supplementary questions
初识生成对抗网络(12)——利用Pytorch搭建WGAN-GP生成手写数字
是否可以给数据库表授予删除列对象的权限?为什么?
股票网上开户安全吗?小白求指导
Is the securities account given by Qiantang education business school safe? Can I open an account?
Static web server