コード例 #1
0
 private void ShowChange(lhBundleBuilder.AssetData asset, string hasCode)
 {
     string[] split = hasCode.Split(',');
     if (asset.hashCode.Equals(split[0]) && asset.metaHashCode.Equals(split[1]))
     {
         GUI.color = Color.green;
         GUILayout.Label("√");
         GUI.color = Color.white;
     }
     else
     {
         GUI.color = Color.yellow;
         GUILayout.Label("!");
         GUI.color = Color.white;
     }
 }
コード例 #2
0
        private static string getFileHashCode(lhBundleBuilder.AssetData asset)
        {
            byte[] fileBytes   = File.ReadAllBytes(Application.dataPath.Replace("Assets", "") + asset.path);
            byte[] hashBytes   = m_shal1.ComputeHash(fileBytes);
            var    newHashCode = Convert.ToBase64String(hashBytes);

            string newMetaHashCode = "";
            string metaFile        = Application.dataPath.Replace("Assets", "") + asset.path + ".meta";

            if (File.Exists(metaFile))
            {
                byte[] metaBytes = File.ReadAllBytes(metaFile);
                newMetaHashCode = Convert.ToBase64String(m_shal1.ComputeHash(metaBytes));
            }
            else
            {
                newMetaHashCode = "";
            }
            return(newHashCode + "," + newMetaHashCode);
        }