Ejemplo n.º 1
0
        public void Diff(AssetBundlesConfig newcfg, out List <string> changes, out List <string> adds, out List <string> dels)
        {
            changes = new List <string>();
            adds    = new List <string>();
            dels    = new List <string>();

            Dictionary <string, int> newabs = new Dictionary <string, int>();

            foreach (AssetBundleInfo abInfo in newcfg._assetbundles.Values)
            {
                newabs.Add(abInfo.assetbundlename, abInfo.version);
            }

            Dictionary <string, int> curabs = new Dictionary <string, int>();

            foreach (AssetBundleInfo abInfo in _assetbundles.Values)
            {
                curabs.Add(abInfo.assetbundlename, abInfo.version);
            }

            foreach (KeyValuePair <string, int> pair in newabs)
            {
                string abname = pair.Key;
                int    newver = pair.Value;
                int    curver;
                if (curabs.TryGetValue(abname, out curver))
                {
                    if (curver != newver)
                    {
                        changes.Add(abname);
                    }
                }
                else
                {
                    adds.Add(abname);
                }
            }

            foreach (KeyValuePair <string, int> pair in curabs)
            {
                string abname = pair.Key;
                if (!newabs.ContainsKey(abname))
                {
                    dels.Add(abname);
                }
            }
        }
Ejemplo n.º 2
0
 public ResLoader()
 {
     _cfg = new AssetBundlesConfig();
     _cfg.Load(ResConfig.assetConfigPath);
 }