public static void ImportLayersUI(Object psdFile, ImportUserData importSettings, List <int[]> layerIndices) { int total = layerIndices.Count; Action <int, ImportLayerData> layerCallback = (current, layer) => EditorCoroutineRunner.UpdateUI($"[{current}/{total}] Layer: {layer.name}", (float)current / total); IEnumerator importCoroutine = ImportCoroutine(psdFile, importSettings.TargetDirectory, importSettings, layerIndices, layerCallback); EditorCoroutineRunner.StartCoroutineWithUI(importCoroutine, "Importing PSD Layers", true); }
public static void ImportLayersUI(Object psdFile, ImportUserData importSettings, List <int[]> layerIndices) { int total = layerIndices.Count; EditorCoroutineRunner.StartCoroutineWithUI( ImportCoroutine(psdFile, importSettings, layerIndices, true, layerCallback: (current, layer) => { string text = string.Format("[{0}/{1}] Layer: {2}", current, total, layer.name); float percent = (float)current / total; EditorCoroutineRunner.UpdateUI(text, percent); } ), "Importing PSD Layers", true ); }