Exemple #1
0
 public ExportSettings(ExportSettings settings)
 {
     Export = settings.Export;
     OutputFolder = settings.OutputFolder;
     Extension = settings.Extension;
     PathRewriter = settings.PathRewriter;
 }
Exemple #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));
        }
        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);
        }
Exemple #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));
        }