예제 #1
0
 /// <summary>
 /// 异步加载单个文件
 /// </summary>
 /// <param name="pathOrAddress">路径/地址</param>
 /// <param name="complete">单个资源加载完成委托</param>
 /// <param name="priority">加载优先级</param>
 /// <param name="progress">单个资源加载进度委托</param>
 /// <param name="userData">携带参数</param>
 /// <returns></returns>
 public AssetLoaderHandle LoadAssetAsync(
     string pathOrAddress,
     OnAssetLoadComplete complete,
     AssetLoaderPriority priority = AssetLoaderPriority.Default,
     OnAssetLoadProgress progress = null,
     SystemObject userData        = null)
 {
     if (m_IsInit)
     {
         return(m_AssetLoader.LoadOrInstanceBatchAssetAsync(new string[] { pathOrAddress }, false, priority, complete, progress, null, null, userData));
     }
     else
     {
         Debug.LogError("AssetManager::LoadAssetAsync->init is failed");
         return(null);
     }
 }
예제 #2
0
        /// <summary>
        /// 开始加载场景
        /// </summary>
        /// <param name="loadData"></param>
        private void SceneLoadStart(SceneLoadData loadData)
        {
            if (m_LoaderMode == AssetLoaderMode.AssetDatabase)
            {
#if UNITY_EDITOR
                loadData.AsyncOperation = UnityEditor.SceneManagement.EditorSceneManager.LoadSceneAsyncInPlayMode(loadData.AssetPath, new LoadSceneParameters(loadData.LoadMode));
#endif
            }
            else if (m_LoaderMode == AssetLoaderMode.AssetBundle)
            {
                loadData.LoaderHandle = m_AssetLoader.LoadOrInstanceBatchAssetAsync(new string[] { loadData.PathOrAddress }, false, AssetLoaderPriority.High, null, null, null, null, null);
            }
        }