|
@@ -11,7 +11,8 @@ namespace GFGGame
|
|
|
Both
|
|
|
}
|
|
|
|
|
|
- public class PreloadManager : SingletonMonoBase<PreloadManager>
|
|
|
+ //负责提供获得卡牌和衣服部件时开启后台预下载的接口
|
|
|
+ public class PreDownloadManager : SingletonMonoBase<PreDownloadManager>
|
|
|
{
|
|
|
private List<string> waitList = new List<string>();
|
|
|
private ResourceDownloaderOperation downloaderOperation;
|
|
@@ -32,7 +33,7 @@ namespace GFGGame
|
|
|
/// <param name="resType">可以选择预加载静态图或者动画或者全部</param>
|
|
|
/// <param name="excludeType">排除一些类型,由ConstDressUpItemType定义</param>
|
|
|
/// <param name="includeOptional">是否包含可选部件</param>
|
|
|
- public void PreloadSuitRes(int suitId, ResType resType, int[] excludeType, bool includeOptional)
|
|
|
+ public void PreDownloadSuitRes(int suitId, ResType resType, int[] excludeType, bool includeOptional)
|
|
|
{
|
|
|
SuitCfg suitCfg = SuitCfgArray.Instance.GetCfg(suitId);
|
|
|
if (suitCfg == null)
|
|
@@ -43,61 +44,61 @@ namespace GFGGame
|
|
|
List<int> targetItemList = DressUpUtil.GetSuitItems(suitId, resType != ResType.Sprite, excludeType, includeOptional, false);
|
|
|
foreach (var itemId in targetItemList)
|
|
|
{
|
|
|
- PreloadDressUpRes(itemId, resType);
|
|
|
+ PreDownloadDressUpRes(itemId, resType);
|
|
|
}
|
|
|
if (resType != ResType.Sprite)
|
|
|
{
|
|
|
if (!string.IsNullOrEmpty(suitCfg.aniRes))
|
|
|
{
|
|
|
string assetPath = ResPathUtil.GetDressUpAnimationPath(suitCfg.aniRes);
|
|
|
- PreloadManager.Instance.TryAdd(assetPath);
|
|
|
+ PreDownloadManager.Instance.TryAdd(assetPath);
|
|
|
assetPath = ResPathUtil.GetDressUpEffectPath(suitCfg.aniRes, true);
|
|
|
- PreloadManager.Instance.TryAdd(assetPath);
|
|
|
+ PreDownloadManager.Instance.TryAdd(assetPath);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public void PreloadDressUpRes(int itemId, ResType resType = ResType.Sprite)
|
|
|
+ public void PreDownloadDressUpRes(int itemId, ResType resType = ResType.Sprite)
|
|
|
{
|
|
|
ItemCfg dressUpCfg = ItemCfgArray.Instance.GetCfg(itemId);
|
|
|
string assetPath;
|
|
|
if (resType != ResType.Animation)
|
|
|
{
|
|
|
assetPath = ResPathUtil.GetDressUpLayerSpriteResPath(dressUpCfg, 1);
|
|
|
- PreloadManager.Instance.TryAdd(assetPath);
|
|
|
+ PreDownloadManager.Instance.TryAdd(assetPath);
|
|
|
assetPath = ResPathUtil.GetDressUpLayerSpriteResPath(dressUpCfg, 2);
|
|
|
- PreloadManager.Instance.TryAdd(assetPath);
|
|
|
+ PreDownloadManager.Instance.TryAdd(assetPath);
|
|
|
assetPath = ResPathUtil.GetDressUpLayerSpriteResPath(dressUpCfg, 3);
|
|
|
- PreloadManager.Instance.TryAdd(assetPath);
|
|
|
+ PreDownloadManager.Instance.TryAdd(assetPath);
|
|
|
assetPath = ResPathUtil.GetDressUpLayerEffectResPath(dressUpCfg, 1, false);
|
|
|
- PreloadManager.Instance.TryAdd(assetPath);
|
|
|
+ PreDownloadManager.Instance.TryAdd(assetPath);
|
|
|
assetPath = ResPathUtil.GetDressUpLayerEffectResPath(dressUpCfg, 2, false);
|
|
|
- PreloadManager.Instance.TryAdd(assetPath);
|
|
|
+ PreDownloadManager.Instance.TryAdd(assetPath);
|
|
|
assetPath = ResPathUtil.GetDressUpLayerEffectResPath(dressUpCfg, 3, false);
|
|
|
- PreloadManager.Instance.TryAdd(assetPath);
|
|
|
+ PreDownloadManager.Instance.TryAdd(assetPath);
|
|
|
}
|
|
|
if (resType != ResType.Sprite)
|
|
|
{
|
|
|
assetPath = ResPathUtil.GetDressUpLayerAnimationResPath(dressUpCfg, 1);
|
|
|
- PreloadManager.Instance.TryAdd(assetPath);
|
|
|
+ PreDownloadManager.Instance.TryAdd(assetPath);
|
|
|
assetPath = ResPathUtil.GetDressUpLayerAnimationResPath(dressUpCfg, 2);
|
|
|
- PreloadManager.Instance.TryAdd(assetPath);
|
|
|
+ PreDownloadManager.Instance.TryAdd(assetPath);
|
|
|
assetPath = ResPathUtil.GetDressUpLayerAnimationResPath(dressUpCfg, 3);
|
|
|
- PreloadManager.Instance.TryAdd(assetPath);
|
|
|
+ PreDownloadManager.Instance.TryAdd(assetPath);
|
|
|
assetPath = ResPathUtil.GetDressUpLayerEffectResPath(dressUpCfg, 1, true);
|
|
|
- PreloadManager.Instance.TryAdd(assetPath);
|
|
|
+ PreDownloadManager.Instance.TryAdd(assetPath);
|
|
|
assetPath = ResPathUtil.GetDressUpLayerEffectResPath(dressUpCfg, 2, true);
|
|
|
- PreloadManager.Instance.TryAdd(assetPath);
|
|
|
+ PreDownloadManager.Instance.TryAdd(assetPath);
|
|
|
assetPath = ResPathUtil.GetDressUpLayerEffectResPath(dressUpCfg, 3, true);
|
|
|
- PreloadManager.Instance.TryAdd(assetPath);
|
|
|
+ PreDownloadManager.Instance.TryAdd(assetPath);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public void PreloadCardAnimationRes(int itemId)
|
|
|
+ public void PreDownloadCardAnimationRes(int itemId)
|
|
|
{
|
|
|
ItemCfg cardCfg = ItemCfgArray.Instance.GetCfg(itemId);
|
|
|
string assetPath = ResPathUtil.GetCardAnimationPath(cardCfg.res);
|
|
|
- PreloadManager.Instance.TryAdd(assetPath);
|
|
|
+ PreDownloadManager.Instance.TryAdd(assetPath);
|
|
|
}
|
|
|
|
|
|
private void Update()
|