示例#1
0
 public ResourceItemConfig(string _RootName, ResourceItemConfig _Parent, string _Path)
 {
     RootName       = _RootName;
     Path           = _Path;
     Name           = PathTools.GetPathFolderName(Path);
     ModelName      = _Parent == null ? ModelName : _Parent.ModelName;
     Layer          = _Parent == null ? 0 : _Parent.Layer + 1;
     ChildBuildItem = new List <ResourceItemConfig>();
     if (PathTools.IsDirectory(Path))
     {
         string[] fileList = Directory.GetFileSystemEntries(Path);
         foreach (string file in fileList)
         {
             ResourceItemConfig Item = new ResourceItemConfig(RootName, this, file);
             if (Item.NodelType != ResourceBuildNodelType.UselessNodel)
             {
                 ChildBuildItem.Add(Item);
             }
         }
         if (ChildBuildItem.Count > 0)
         {
             NodelType = ResourceBuildNodelType.FolderNodel;
         }
         else
         {
             NodelType = ResourceBuildNodelType.UselessNodel;
         }
     }
     else
     {
         if (PathTools.CheckSuffix(Path, ToolsConfig.CanBuildFileTypes))
         {
             Name      = Name.Substring(0, Name.IndexOf("."));
             NodelType = ResourceBuildNodelType.ResourcesItemNodel;
         }
         else
         {
             NodelType = ResourceBuildNodelType.UselessNodel;
         }
     }
 }