当前位置:网站首页>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 .
边栏推荐
- [thesis study] vqmivc
- Is it safe to open an account online? Xiaobai asks for guidance
- Go language learning tutorial (13)
- Electronics: Lesson 008 - Experiment 6: very simple switches
- Remove headers from some pages in a word document
- TCP MIN_RTO 辩证考
- Free SSL certificate acquisition tutorial
- The first game of 2021 ICPC online game
- Stm32cubemx Learning (5) Input capture Experiment
- Scanpy (VII) spatial data analysis based on scanorama integrated scrna seq
猜你喜欢

以科技赋能设计之美,vivo携手知名美院打造“产学研”计划

Find out the possible memory leaks caused by the handler and the solutions

Scanpy (VII) spatial data analysis based on scanorama integrated scrna seq
![[thesis study] vqmivc](/img/38/a97ac763a7d6e71d4c7340c7abb6e7.png)
[thesis study] vqmivc

Establish open data set standards and enable AI engineering implementation

Sword finger offer (simple level)

堆栈认知——栈溢出实例(ret2libc)

物联网毕设(智能灌溉系统 -- Android端)

STM32CubeMX 学习(5)输入捕获实验

VOCALOID notes
随机推荐
Data-centric vs. Model-centric. The Answer is Clear!
How to do factor analysis? Why should data be standardized?
Free SSL certificate acquisition tutorial
什么是SKU和SPU,SKU,SPU的区别是什么
Quickly build a real-time face mask detection system in five minutes (opencv+paddlehub with source code)
How is the ISM model analyzed?
Luogu p6822 [pa2012]tax (shortest circuit + edge change point)
Bluecmsv1.6- code audit
想开个户,网上股票开户安不安全?
[red flag Cup] Supplementary questions
Go language learning tutorial (13)
Unity Addressable批量管理
Not afraid of losing a hundred battles, but afraid of losing heart
4 reasons for adopting "safe left shift"
FM signal, modulated signal and carrier
Rank sum ratio (RSR) index calculation
Find out the possible memory leaks caused by the handler and the solutions
Establish open data set standards and enable AI engineering implementation
家庭服务器门户Easy-Gate
Common action types