Exemple #1
0
        public static LevelPrefabFileInfo CreateSubdirectory(LevelPrefabFileInfo parent, string name)
        {
            LevelPrefabFileInfo child = new LevelPrefabFileInfo(name, parent);

            parent.AddChildInfo(child);

            return(child);
        }
Exemple #2
0
        public static void AddSubfoldersRecursive(DirectoryInfo directory, LevelPrefabFileInfo parent)
        {
            foreach (DirectoryInfo subdirectory in directory.GetDirectories())
            {
                AddSubfoldersRecursive(subdirectory, CreateSubdirectory(parent, subdirectory.Name));
            }

            foreach (FileInfo prefab in directory.GetFiles("*.bytes"))
            {
                AddOrUpdatePrefabInfo(parent, prefab);
            }
        }
Exemple #3
0
        public static LevelPrefabFileInfo AddOrUpdatePrefabInfo(LevelPrefabFileInfo parent, FileInfo file)
        {
            string prefab_path        = Resource.NormalizePath(file.FullName);
            string name               = Path.GetFileNameWithoutExtension(prefab_path);
            LevelPrefabFileInfo entry = parent.GetChildFileInfo((LevelPrefabFileInfo value) => value.Name_ == name);

            if (entry is null)
            {
                entry = new LevelPrefabFileInfo(name, prefab_path, parent);
                parent.AddChildInfo(entry);
            }
            else
            {
                entry.CustomPrefabPath_ = prefab_path;
            }

            return(entry);
        }