之前文檔上說勾選了Include in build之后,就不需要自己增加一個Binding腳本,但是仍然會彈出警告,并且會出現(xiàn)白圖現(xiàn)象
Tight Packing 勾選之后當Sprite有透明通道可能會出現(xiàn)錯位 不推薦勾選
選項取消勾選之后打包AssetBundle會報警告 并且出現(xiàn)白圖現(xiàn)象 那是因為沒有進行bing
?SpriteAtlasManager. atlasRequested wasn't listened to while UIBgAtlas requested.文章來源:http://www.zghlxwxcb.cn/news/detail-507522.html
?創(chuàng)建SpriteAtlasBinding.cs 內(nèi)容如下? bundle加載代碼還是需要自己去寫? 然后腳本掛載在一個物體上再次運行 熱更即可發(fā)現(xiàn)沒有出現(xiàn)白圖以及警告的情況文章來源地址http://www.zghlxwxcb.cn/news/detail-507522.html
using UnityEngine;
using UnityEngine.U2D;
public class SpriteAtlasBinding : MonoBehaviour
{
void OnEnable()
{
SpriteAtlasManager.atlasRequested += RequestAtlas;
}
void OnDisable()
{
SpriteAtlasManager.atlasRequested -= RequestAtlas;
}
void RequestAtlas(string atlasName, System.Action<SpriteAtlas> callback)
{
SpriteAtlas spatlas = AssetBundleManager.Instance.LoadAsset<SpriteAtlas>(GameConfig.GetSpriteAtlasPath(atlasName));
callback(spatlas);
}
}
到了這里,關(guān)于Unity 解決SpriteAtlas圖集打包AssetBundle白圖問題的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!