コード例 #1
0
    //
#if UNITY_ANDROID && (!UNITY_EDITOR)
    /// <summary>
    /// 复制StreamingAsset资源
    /// </summary>
    private void CopyAssetDirectory()
    {
        if (GloablDefine.resbasePathList.Count > 0 && resbaseIndex < GloablDefine.resbasePathList.Count)
        {
            var           resbasePath     = GloablDefine.resbasePathList[resbaseIndex];
            var           fullresbasePath = Path.Combine(StreamingAssetHelper.AssetPathDir, resbasePath);
            DirectoryInfo directoryInfo   = new DirectoryInfo(fullresbasePath);
            resbaseIndex++;
            //Debug.LogWarning("------------------------>resbasePath" + fullresbasePath);
            //Debug.LogWarning("------------------------>resbasePath Is Exist" + directoryInfo.Exists);
            if (!directoryInfo.Exists)
            {
                UICopyingAssetHelper.Instance().UpdateUI(resbaseIndex, GloablDefine.resbasePathList.Count, "首次运行游戏正在解压资源...");
                StreamingAssetHelper.CopyAssetDirectoryInThread(resbasePath, resbasePath, OnCopyAssetDirectoryNext);
            }
            else
            {
                OnCopyAssetDirectoryNext(true);
            }
        }
        else
        {
            OnCopyAssetDirectoryFinished();
        }
    }
コード例 #2
0
 /// <summary>
 /// 复制StreamingAsset资源
 /// </summary>
 private void CopyAssetDirectory()
 {
     if (GloablDefine.resbasePathList.Count > 0 && resbaseIndex < GloablDefine.resbasePathList.Count)
     {
         resbaseIndex++;
         var           resbasePath     = GloablDefine.resbasePathList[resbaseIndex];
         var           fullresbasePath = Path.Combine(StreamingAssetHelper.AssetPathDir, resbasePath);
         DirectoryInfo directoryInfo   = new DirectoryInfo(fullresbasePath);
         Debug.LogWarning("------------------------>resbasePath" + fullresbasePath);
         Debug.LogWarning("------------------------>resbasePath Is Exist" + directoryInfo.Exists);
         if (!directoryInfo.Exists)
         {
             StreamingAssetHelper.CopyAssetDirectoryInThread(resbasePath, resbasePath, OnCopyAssetDirectoryFinished);
         }
     }
 }