Exemplo n.º 1
0
 private static void ApplyPresetToAssetImporter(AssetImporter assetImporter, PresetData preset)
 {
     if (preset.Preset.ApplyTo(assetImporter, preset.TargetParameters))
     {
         assetImporter.SaveAndReimport();
         EditorUtility.SetDirty(assetImporter);
     }
 }
Exemplo n.º 2
0
        public static bool TryToGetParentPresetSettings(string relativeFolderPath, AssetImporter assetImporter,
                                                        out PresetData preset)
        {
            DirectoryInfo currentDirectory = new DirectoryInfo(RelativeToAbsolutePath(relativeFolderPath)).Parent;

            preset = default;
            while (currentDirectory != null && !string.Equals(currentDirectory.FullName, Directory.GetCurrentDirectory(), StringComparison.Ordinal))
            {
                if (PresetManagerStorage.Instance.TryGetAssetPresetFromFolder(AbsoluteToRelativePath(currentDirectory.FullName),
                                                                              assetImporter, out preset))
                {
                    break;
                }
                currentDirectory = currentDirectory.Parent;
            }

            return(preset.Preset != null);
        }
Exemplo n.º 3
0
 public static bool TryGetAssetPresetFromFolder(string relativeFolderPath, AssetImporter assetImporter,
                                                out PresetData preset)
 {
     return(PresetManagerStorage.Instance.TryGetAssetPresetFromFolder(relativeFolderPath, assetImporter, out preset));
 }