当前位置:网站首页>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 .
边栏推荐
- Home server portal easy gate
- Wechat applet opening customer service message function development
- 以科技赋能设计之美,vivo携手知名美院打造“产学研”计划
- Allgero reports an error: program has encoded a problem and must exit The design will be saved as a . SAV file
- Nodehandle common member functions
- Stm32cubemx learning (5) input capture experiment
- 想开个户,网上股票开户安不安全?
- 软件工程复习题
- First experience Amazon Neptune, a fully managed map database
- Data-centric vs. Model-centric. The Answer is Clear!
猜你喜欢

Biweekly investment and financial report: capital ambush Web3 infrastructure

图像超分综述:超长文一网打尽图像超分的前世今生 (附核心代码)

CVPR 2022 oral 2D images become realistic 3D objects in seconds

A solution to slow startup of Anaconda navigator

Use pytorch to build mobilenetv2 and learn and train based on migration

TCP acceleration notes

How do I install the software using the apt get command?

What about the exponential smoothing index?

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

TCP and UDP
随机推荐
面试前准备好这些,Offer拿到手软,将军不打无准备的仗
Sword finger offer (simple level)
How to analyze the grey prediction model?
Free SSL certificate acquisition tutorial
想开个户,网上股票开户安不安全?
After using the remote control of the working machine, problems occurred in the use of the local ROS, and the roscore did not respond
Stm32cubemx Learning (5) Input capture Experiment
Nodehandle common member functions
Sword finger offer (medium level)
How to calculate the D value and W value of statistics in normality test?
以科技赋能设计之美,vivo携手知名美院打造“产学研”计划
[supplementary question] 2021 Niuke summer multi school training camp 9-N
Unity Addressable批量管理
[thesis study] vqmivc
Establish open data set standards and enable AI engineering implementation
TCP stuff
在二叉树(搜索树)中找到两个节点的最近公共祖先(剑指offer)
The first game of 2021 ICPC online game
Rank sum ratio (RSR) index calculation
Remove headers from some pages in a word document