예제 #1
0
        private void OnCreateVersionInfoCallBack()
        {
            if (m_PlatformSelected == null)
            {
                return;
            }
            for (int index = 0; index < m_PlatformSelected.Count; ++index)
            {
                string path = m_OutputPath + m_PlatformSelected[index];
                if (!Directory.Exists(path))
                {
                    Directory.CreateDirectory(path);
                }
                string        strVersionInfoPath = path + "/VersionInfo.txt";
                DirectoryInfo directory          = new DirectoryInfo(path);
                StringBuilder sb = new StringBuilder();

                FileInfo[] arrFiles = directory.GetFiles("*", SearchOption.AllDirectories);
                for (int i = 0; i < arrFiles.Length; ++i)
                {
                    FileInfo file     = arrFiles[i];
                    string   fullName = file.FullName.Replace('\\', '/');
                    string   name     = fullName.Substring(fullName.IndexOf(m_PlatformSelected[index].ToString()) + m_PlatformSelected[index].ToString().Length + 1);

                    string md5 = EncryptUtil.GetFileMD5(fullName);
                    if (string.IsNullOrEmpty(md5))
                    {
                        continue;
                    }

                    string size = file.Length.ToString();

                    string strLine = string.Format("{0};{1};{2};{3}", name, md5, size, 1);
                    sb.AppendLine(strLine);
                }

                IOUtil.CreateTextFile(strVersionInfoPath, sb.ToString());
                this.ShowNotification(new GUIContent("create version file finished"));
                UnityEngine.Debug.Log("create version file finished");
                FolderUtil.SelectFile(strVersionInfoPath);
            }
        }