// inPath 类似这样 Assets/Res/Image/UI/Common/denglu_srk.png , outPath = Assets/Prefabs/Resources/Atlas/aaa.asset public void packSprite(string inPath, string outPath) { m_soSprite = ScriptableObject.CreateInstance<SOSpriteList>(); Sprite[] spriteArr = AtlasPrefabUtil.loadAllSprite(inPath); m_soSprite.addSprite("aaa", spriteArr[0]); AssetDatabase.CreateAsset(m_soSprite, outPath); }
public void addSprite2SO(SOSpriteList soSprite) { string assetsImagePath = ExportUtil.convFullPath2AssetsPath(m_fullPath); Sprite[] allSpritesArr = AtlasPrefabUtil.loadAllSprite(assetsImagePath); soSprite.addSprite(m_subPathNoExt, allSpritesArr[0]); }