예제 #1
0
        // Import from app
        public void Import()
        {
            try
            {
                // Does nothing, if we aren't on Android
                finder.ExtractObb();

                // Attempt to clean up old import
                if (!CleanImport())
                {
                    return;
                }

                // Get all assets
                IEnumerable <string> assetFiles = GetAssetFiles();

                // Export all asset content
                BuildAssetStructures(assetFiles);

                // Write log
                WriteImportLog();

                // Find any streaming asset files
                ImportStreamAssets();
            }
            catch (Exception ex)
            {
                ValkyrieDebug.Log("Import caused " + ex.GetType().Name + ": " + ex.Message + " " + ex.StackTrace);
            }
        }
예제 #2
0
        // Import from app
        public void Import()
        {
            finder.ExtractObb();
            // List all assets files
            string[] assetFiles = Directory.GetFiles(finder.location, "*.assets");

            // Attempt to clean up old import
            if (!CleanImport())
            {
                return;
            }
            // Import from all assets files
            foreach (string s in assetFiles)
            {
                Import(s);
            }
            if (Directory.Exists(Path.GetTempPath() + "Valkyrie/Obb"))
            {
                Directory.Delete(Path.GetTempPath() + "Valkyrie/Obb", true);
            }

            // Find any streaming asset files
            string[] streamFiles = Directory.GetFiles(finder.location + "/StreamingAssets", "*", SearchOption.AllDirectories);
            ImportStreamAssets(streamFiles);
        }
예제 #3
0
        // Import from app
        public void Import()
        {
            try
            {
                finder.ExtractObb(); // Utilized by Android

                // List all assets files
                var assetFiles = Directory.GetFiles(finder.location, "*.assets").ToList();

                // Attempt to clean up old import
                if (!CleanImport())
                {
                    return;
                }
                // Import from all assets
                assetFiles.ForEach(s => Import(s));

                // Find any streaming asset files
                string streamDir = Path.Combine(finder.location, "StreamingAssets");
                if (Directory.Exists(streamDir))
                {
                    string[] streamFiles = Directory.GetFiles(streamDir, "*", SearchOption.AllDirectories);
                    ImportStreamAssets(streamFiles);
                }
                else
                {
                    ValkyrieDebug.Log("StreamingAssets dir '" + streamDir + "' not found");
                }
            }
            catch (Exception ex)
            {
                ValkyrieDebug.Log("Import caused " + ex.GetType().Name + ": " + ex.Message + " " + ex.StackTrace);
            }
        }