/// <summary> /// 加载图集 /// </summary> void AtlasTest() { //Object[] _atlas= Resources.LoadAll("uimain"); //Sprite _sprite = SpriteFormAtlas(_atlas, "g_bg_1"); //Debug.LogError(_sprite); //icon.sprite = _sprite; ResMgr.Ins.LoadAB("uimainatlas.unity3d", (AssetBundle ab) => { Logger.Log(ab.GetAllAssetNames().Length); Logger.Log(ab.GetAllAssetNames()[0]); Sprite[] spriteObj = ab.LoadAllAssets <Sprite>(); Sprite _sprite = ResMgr.SpriteFormAtlas(spriteObj, "song"); atlasBtn.GetComponentInChildren <Image>().sprite = _sprite; }); }