Пример #1
0
 public AndroidGameStructure(FileCollection collection, string rootPath) :
     this(collection, rootPath, string.Empty)
 {
 }
Пример #2
0
 public void Export(string exportPath, Func <Object, bool> filter)
 {
     FileCollection.Exporter.Export(exportPath, FileCollection, FileCollection.FetchAssets().Where(t => filter(t)));
 }
Пример #3
0
 public GameStructure()
 {
     FileCollection   = new FileCollection(OnRequestDependency, OnRequestAssembly);
     m_mixedStructure = new MixedGameStructure(FileCollection);
 }
Пример #4
0
 public MixedGameStructure(FileCollection collection) :
     base(collection)
 {
 }
Пример #5
0
 public void ReadWebFile(FileCollection collection)
 {
     m_stream.Position = m_offset;
     collection.ReadWebFile(m_stream, FilePath);
 }
Пример #6
0
 public void ReadSerializedFile(FileCollection collection, Action <string> dependencyCallback)
 {
     m_stream.Position = m_offset;
     collection.ReadSerializedFile(m_stream, FilePath, Name, dependencyCallback);
 }
Пример #7
0
 public Program()
 {
     m_collection = new FileCollection();
     m_collection.EventRequestDependency += OnRequestDependency;
 }
Пример #8
0
 public static IEnumerable <Object> FetchExportObjects(FileCollection collection)
 {
     //yield break;
     return(collection.FetchAssets());
 }
Пример #9
0
        public WebGLStructure(FileCollection collection, string rootPath) :
            base(collection)
        {
            if (string.IsNullOrEmpty(rootPath))
            {
                throw new ArgumentNullException(rootPath);
            }
            m_root = new DirectoryInfo(DirectoryUtils.ToLongPath(rootPath));
            if (!m_root.Exists)
            {
                throw new Exception($"Directory '{rootPath}' doesn't exist");
            }

            Dictionary <string, string> files = new Dictionary <string, string>();
            string buildPath = Path.Combine(m_root.FullName, BuildName);

            if (Directory.Exists(buildPath))
            {
                DirectoryInfo buildDirectory = new DirectoryInfo(buildPath);
                foreach (FileInfo file in buildDirectory.EnumerateFiles())
                {
                    if (file.Name.EndsWith(DataWebExtension, StringComparison.Ordinal))
                    {
                        Name = file.Name.Substring(0, file.Name.Length - DataWebExtension.Length);
                        files.Add(Name, file.FullName);
                        break;
                    }
                }
                DataPathes = new string[] { rootPath, buildPath };
            }
            else
            {
                string developmentPath = Path.Combine(m_root.FullName, DevelopmentName);
                if (Directory.Exists(developmentPath))
                {
                    DirectoryInfo buildDirectory = new DirectoryInfo(developmentPath);
                    foreach (FileInfo file in buildDirectory.EnumerateFiles())
                    {
                        if (file.Extension == DataExtension)
                        {
                            Name = file.Name.Substring(0, file.Name.Length - DataExtension.Length);
                            files.Add(Name, file.FullName);
                            break;
                        }
                    }
                    DataPathes = new string[] { rootPath, developmentPath };
                }
                else
                {
                    string releasePath = Path.Combine(m_root.FullName, ReleaseName);
                    if (Directory.Exists(releasePath))
                    {
                        DirectoryInfo buildDirectory = new DirectoryInfo(releasePath);
                        foreach (FileInfo file in buildDirectory.EnumerateFiles())
                        {
                            if (file.Extension == DataGzExtension)
                            {
                                Name = file.Name.Substring(0, file.Name.Length - DataGzExtension.Length);
                                files.Add(Name, file.FullName);
                                break;
                            }
                        }
                        DataPathes = new string[] { rootPath, releasePath };
                    }
                    else
                    {
                        throw new Exception("Build directory hasn't been found");
                    }
                }
            }

            if (files.Count == 0)
            {
                throw new Exception("No files has been found");
            }

            CollectStreamingAssets(m_root, files);
            Files = files;

            Assemblies = new Dictionary <string, string>();
            //m_fileCollection.AssemblyManager.ScriptingBackEnd = ScriptingBackEnd.Il2Cpp;
        }