Пример #1
0
 /// <summary>
 /// Assetbundle加载完成后, 同步加载Asset
 /// </summary>
 /// <returns></returns>
 public Boolean CheckCompleted()
 {
     try
     {
         if (!m_res_assetbundle.CheckLoaded())
         {
             return(true);
         }
         UnityEngine.Object asset = m_res_assetbundle.GetLoadedAsset(m_asset_name);
         if (asset != null)
         {
             //asset.name = asset.name.ToLower();
             if (!m_callback(true, m_res_assetbundle, asset))
             {
                 return(true);
             }
             m_res_assetbundle.Release();
             return(true);
         }
         if (!m_asset_loading)
         {
             m_asset_loading = true;
             m_res_assetbundle.LoadAsset(m_asset_name, m_asset_type);
         }
         return(false);
     }
     catch (Exception)
     {
         m_callback(false, m_res_assetbundle, null);
         m_res_assetbundle.Release();
         return(true);
     }
 }
Пример #2
0
 public Boolean CheckCompleted()
 {
     if (ResourceState.Loaded == m_resource.State)
     {
         if (m_scene_loaded)
         {
             m_resource.Release();
             return(true);
         }
         if (m_scene_load_opt != null)
         {
             return(false);
         }
         ResourceManager.Instance.StartCoroutine(_loadSceneAsync());
         return(false);
     }
     else if (ResourceState.Error == m_resource.State)
     {
         m_callback(false);
         return(true);
     }
     return(false);
 }