当前位置:网站首页>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 .
边栏推荐
- 初识生成对抗网络(12)——利用Pytorch搭建WGAN-GP生成手写数字
- How to calculate the D value and W value of statistics in normality test?
- Is there any risk in the security of new bonds
- 初识生成对抗网络(11)——利用Pytorch搭建WGAN生成手写数字
- Network model -- OSI model and tcp/ip model
- Is there any risk in making new bonds
- First experience Amazon Neptune, a fully managed map database
- Quickly build a real-time face mask detection system in five minutes (opencv+paddlehub with source code)
- 初体验完全托管型图数据库 Amazon Neptune
- 物联网毕设(智能灌溉系统 -- Android端)
猜你喜欢

FM signal, modulated signal and carrier

Unity Addressable批量管理

Stack awareness - stack overflow instance (ret2libc)

Mr. Tang's lecture on operational amplifier (Lecture 7) -- Application of operational amplifier

A solution to slow startup of Anaconda navigator

How to calculate the information entropy and utility value of entropy method?
![Luogu p1073 [noip2009 improvement group] optimal trade (layered diagram + shortest path)](/img/cb/046fe4b47898fd6db86edc8a267c34.png)
Luogu p1073 [noip2009 improvement group] optimal trade (layered diagram + shortest path)

CVPR 2022 Oral 2D图像秒变逼真3D物体

2022年毕业生求职找工作青睐哪个行业?

Sword finger offer (medium level)
随机推荐
CVPR 2022 Oral 2D图像秒变逼真3D物体
GIL问题带来的问题,解决方法
4 raisons inconnues d'utiliser le "déplacement sûr à gauche"
[supplementary question] 2021 Niuke summer multi school training camp 9-N
Common SRV types
Find out the possible memory leaks caused by the handler and the solutions
Establish open data set standards and enable AI engineering implementation
What is SKU and SPU? What is the difference between SKU and SPU
Use pytorch to build mobilenetv2 and learn and train based on migration
iframe简单使用 、获取iframe 、获取iframe 元素值 、iframe获取父页面的信息
Home server portal easy gate
Prepare these before the interview. The offer is soft. The general will not fight unprepared battles
Is it safe to open an account online? Xiaobai asks for guidance
Black dot = = white dot (MST)
Luogu p5994 [pa2014]kuglarz (XOR thinking +mst)
Ffmpeg+sdl2 for audio playback
每日刷题记录 (三)
[red flag Cup] Supplementary questions
First experience Amazon Neptune, a fully managed map database
Measure the current temperature