示例#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;
        }