/// <summary> /// Watch for changes to the given asset type flags in the given path, and optionally recursing subdirectories. /// If no path is specified, the entire Assets folder will be used. /// If no asset type is specified, all asset types will be observed. /// </summary> public static QuickAssetWatcher Observe(string path = "", UnityAssetType assetType = UnityAssetType.None, bool recurseSubdirectories = true) { QuickAssetWatcher w = new QuickAssetWatcher(path, assetType, recurseSubdirectories); allWatchers.Add(w); return(w); }
/// <summary> /// Extension (with leading dot) for the given Unity asset type /// </summary> public static string[] GetExtensionsForType(UnityAssetType type) { string[] ext; try { ext = assetExtensions [type]; } catch { return(new string[0]); } return(ext); }
/// <summary> /// 如果是内置类型/ Builtin的,只要不存在就重打 /// </summary> /// <param name="unityAssetType"></param> /// <param name="path"></param> /// <returns></returns> private static bool CheckNeedBuildAsset(UnityAssetType unityAssetType, string path) { if (unityAssetType == UnityAssetType.Object) { return(CheckNeedBuildAsset(path)); } var needBuild = !AssetVersionControl.TryCheckExistRecord(path); if (!needBuild && !InternalEditorUtility.inBatchMode) { Debug.LogWarning("Builtin resource handled, no Need To Build " + path); } return(needBuild); }
private QuickAssetWatcher(string path, UnityAssetType assetType, bool recurseSubdirectories) { this.basePath = Path.Combine("Assets", path); this.observedAssetTypes = assetType; this.recurseSubdirectories = recurseSubdirectories; }
/// <summary> /// Extension (with leading dot) for the given Unity asset type /// </summary> public static string[] GetExtensionsForType(UnityAssetType type) { string[] ext; try { ext = assetExtensions [type]; } catch { return new string[0]; } return ext; }