Ejemplo n.º 1
0
        public void SearchAll()
        {
            var resDirs = new List <DirectoryInfo>();

            foreach (var path in SearchPaths)
            {
                resDirs.Add(new DirectoryInfo(path));
            }
            foreach (var e in resDirs)
            {
                var files = e.GetFiles("*", SearchOption.AllDirectories)
                            .Where(file => !file.Name.EndsWith(".meta"));
                foreach (var f in files)
                {
                    for (var i = 0; i < generators.Count; ++i)
                    {
                        if (generators[i].Belong(f.FullName))
                        {
                            try
                            {
                                generators[i].AddRes(f.FullName);
                            }
                            catch (Exception ex)
                            {
                                Debug.LogError("Auto generate class R failed in: " + f.FullName, AssetUtility.LoadAssetAtFullPath <UnityEngine.Object>(f.FullName));
                                Debug.LogException(ex);
                            }
                        }
                    }
                }
            }
        }