Esempio n. 1
0
 public void AddAssetToCache(AssetKey key, UnityEngine.Object asset)
 {
     if (m_CachedAssetBundleObject != null && m_CachedAssetBundleObject.Contains(key.Name))
     {
         SetCachedAssetMap(key, EStatus.Ready, asset);
     }
 }
Esempio n. 2
0
 internal SceneRequest(AssetBundleManager manager, Int32 priority, AssetBundleCache assetBundleCache, AssetKey assetKey, SceneRequestCallback callback) : base(manager)
 {
     m_Priority         = priority;
     m_AssetBundleCache = assetBundleCache;
     m_AssetKey         = assetKey;
     m_Callback         = callback;
 }
Esempio n. 3
0
 private void SetCachedAssetMap(AssetKey key, EStatus status, UnityEngine.Object asset)
 {
     if (m_CachedAssetMap == null)
     {
         m_CachedAssetMap = new Dictionary <AssetKey, AssetCache>(Data.Assets.Length);
     }
     m_CachedAssetMap[key] = new AssetCache(status, asset);
 }
Esempio n. 4
0
        public UnityEngine.Object GetCachedAsset(AssetKey key)
        {
            AssetCache assetCache;

            if (m_CachedAssetMap != null && m_CachedAssetMap.TryGetValue(key, out assetCache))
            {
                return(assetCache.AssetObject);
            }
            return(null);
        }
Esempio n. 5
0
        public EStatus GetCachedAssetStatus(AssetKey key)
        {
            AssetCache assetCache;

            if (m_CachedAssetMap != null && m_CachedAssetMap.TryGetValue(key, out assetCache))
            {
                return(assetCache.Status);
            }
            return(EStatus.None);
        }
Esempio n. 6
0
 public EStatus LoadAsset(AssetKey key, out AssetAsyncLoad assetLoader)
 {
     if (m_CachedAssetBundleObject != null && m_CachedAssetBundleObject.Contains(key.Name))
     {
         SetCachedAssetMap(key, EStatus.Load, null);
         UnityEngine.AssetBundleRequest asyncRequest = m_CachedAssetBundleObject.LoadAsync(key.Name, key.Type);
         assetLoader = new AssetAsyncLoad(this, key, asyncRequest);
         return(EStatus.Load);
     }
     assetLoader = default(AssetAsyncLoad);
     return(EStatus.Error);
 }
Esempio n. 7
0
 internal AssetAsyncLoad(AssetBundleCache origin, AssetKey key, UnityEngine.AssetBundleRequest asyncRequest)
 {
     m_Origin       = origin;
     m_Key          = key;
     m_AsyncRequest = asyncRequest;
 }