/// <summary>
 /// 从路径中读取
 /// </summary>
 /// <param name="filePath"></param>
 public void readFromPath(string filePath)
 {
     using (FileStream fs = new FileStream(filePath, FileMode.Open, FileAccess.Read))
     {
         if (fs.Length > 4)
         {
             BinaryReader br = new BinaryReader(fs);
             if (br.ReadChar() == 'A' && br.ReadChar() == 'B' && br.ReadChar() == 'D')
             {
                 if (br.ReadChar() == 'T')
                 {
                     fs.Position = 0;
                     Read(fs, false);
                 }
                 else
                 {
                     fs.Position = 0;
                     Read(fs, true);
                 }
             }
             br.Close();
         }
         fs.Close();
         ReDebug.Log(ReLogType.System, "ABDataHelper", string.Format("Init dependency info success, file=", filePath));
     }
 }
Beispiel #2
0
 public void UnloadBundle()
 {
     if (_bundle != null)
     {
         ReDebug.Log(ReLogType.System, "ABObject", "Unload : " + abData.compositeType + " >> " + abName + "(" + abData.debugName + ")");
         _bundle.Unload(false);
     }
     _bundle = null;
 }
        public void Init()
        {
            string localPath = ABPathResolver.GetBundleSourceFile(ABPathResolver.DEPEND_FILE_NAME, false);
            string cachePath = string.Format("{0}/{1}", ABPathResolver.BundleCacheDir, ABPathResolver.DEPEND_FILE_NAME);

            ReDebug.Log(ReLogType.System, "ABDataHelper", "######## " + localPath);

            if (File.Exists(localPath))
            {
                readFromPath(localPath);
            }
            else if (File.Exists(cachePath))
            {
                readFromPath(cachePath);
            }
        }