diff --git a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildSystem/BuildRunner.cs b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildSystem/BuildRunner.cs index fd03c9f..9cc3e67 100644 --- a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildSystem/BuildRunner.cs +++ b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildSystem/BuildRunner.cs @@ -37,14 +37,16 @@ namespace YooAsset.Editor { _buildWatch = Stopwatch.StartNew(); var taskAttribute = task.GetType().GetCustomAttribute(); - BuildLogger.Log($"---------------------------------------->{taskAttribute.Desc}<---------------------------------------"); + if (taskAttribute != null) + BuildLogger.Log($"---------------------------------------->{taskAttribute.Desc}<---------------------------------------"); task.Run(context); _buildWatch.Stop(); // 统计耗时 int seconds = GetBuildSeconds(); TotalSeconds += seconds; - BuildLogger.Log($"{taskAttribute.Desc}耗时:{seconds}秒"); + if (taskAttribute != null) + BuildLogger.Log($"{taskAttribute.Desc}耗时:{seconds}秒"); } catch (Exception e) { diff --git a/Assets/YooAsset/Editor/EditorTools.cs b/Assets/YooAsset/Editor/EditorTools.cs index 8b33a51..a03830f 100644 --- a/Assets/YooAsset/Editor/EditorTools.cs +++ b/Assets/YooAsset/Editor/EditorTools.cs @@ -582,7 +582,7 @@ namespace YooAsset.Editor /// 关键字 /// 分割的结果里是否包含关键字 /// 是否使用初始匹配的位置,否则使用末尾匹配的位置 - private static string Substring(string content, string key, bool includeKey, bool firstMatch = true) + public static string Substring(string content, string key, bool includeKey, bool firstMatch = true) { if (string.IsNullOrEmpty(key)) return content;