Ejemplo n.º 1
0
 public ExportSettings(ExportSettings settings)
 {
     Export = settings.Export;
     OutputFolder = settings.OutputFolder;
     Extension = settings.Extension;
     PathRewriter = settings.PathRewriter;
 }
Ejemplo n.º 2
0
        private static string ExportModel(object model, string modelFileRelativePath, ExportSettings settings)
        {
            if (model == null)
            {
                return(null);
            }
            var    outputFolder = settings.OutputFolder ?? string.Empty;
            string modelPath;

            try
            {
                modelPath = Path.GetFullPath(Path.Combine(outputFolder, settings.PathRewriter(modelFileRelativePath)));
            }
            catch (PathTooLongException)
            {
                modelPath = Path.GetFullPath(Path.Combine(outputFolder, Path.GetRandomFileName()));
            }

            JsonUtility.Serialize(modelPath, model);
            return(StringExtension.ToDisplayPath(modelPath));
        }
Ejemplo n.º 3
0
        private static string ExportModel(object model, string modelFileRelativePath, ExportSettings settings)
        {
            if (model == null) return null;
            var outputFolder = settings.OutputFolder;

            string modelPath = Path.Combine(outputFolder ?? string.Empty, settings.PathRewriter(modelFileRelativePath));

            JsonUtility.Serialize(modelPath, model);
            return StringExtension.ToDisplayPath(modelPath);
        }
Ejemplo n.º 4
0
        private static string ExportModel(object model, string modelFileRelativePath, ExportSettings settings)
        {
            if (model == null)
            {
                return(null);
            }
            var outputFolder = settings.OutputFolder;

            string modelPath = Path.Combine(outputFolder ?? string.Empty, settings.PathRewriter(modelFileRelativePath));

            JsonUtility.Serialize(modelPath, model);
            return(StringExtension.ToDisplayPath(modelPath));
        }