public static void Delay(ImportDone doneFn = null) { if (doneFn != null) { lateImportList.Add(doneFn); } }
public static void ImportTexture(string path, ImportDone doneFn = null) { AssetDatabase.ImportAsset(path); if (doneFn != null) { lateImportList.Add(doneFn); } }
/// <summary> /// /// </summary> /// <param name="max"> Number of part to be added to database</param> /// <returns></returns> public bool ImportPart(int max, bool selectSeleted, PartAction action, CancellationToken token) { List <EplPartProperties> EplParts = GetPartProperties(max, selectSeleted); foreach (var item in EplParts) { if (token.IsCancellationRequested) { token.ThrowIfCancellationRequested(); } if (InsertPart(item, action)) { InsertPartChanged?.Invoke(item); // rase an event to main window } } ImportDone?.Invoke(EplParts); Dispose(); return(true); }