/// <summary> /// 检测配置错误 /// </summary> public void CheckConfigError() { if (AssetDatabase.LoadAssetAtPath <UnityEngine.Object>(CollectPath) == null) { throw new Exception($"Invalid collect path : {CollectPath}"); } if (CollectorType == ECollectorType.None) { throw new Exception($"{nameof(ECollectorType)}.{ECollectorType.None} is invalid in collector : {CollectPath}"); } if (AssetBundleCollectorSettingData.HasPackRuleName(PackRuleName) == false) { throw new Exception($"Invalid {nameof(IPackRule)} class type : {PackRuleName} in collector : {CollectPath}"); } if (AssetBundleCollectorSettingData.HasFilterRuleName(FilterRuleName) == false) { throw new Exception($"Invalid {nameof(IFilterRule)} class type : {FilterRuleName} in collector : {CollectPath}"); } if (AssetBundleCollectorSettingData.HasAddressRuleName(AddressRuleName) == false) { throw new Exception($"Invalid {nameof(IAddressRule)} class type : {AddressRuleName} in collector : {CollectPath}"); } }
/// <summary> /// 收集器是否有效 /// </summary> public bool IsValid() { if (AssetDatabase.LoadAssetAtPath <UnityEngine.Object>(CollectPath) == null) { return(false); } if (CollectorType == ECollectorType.None) { return(false); } if (AssetBundleCollectorSettingData.HasAddressRuleName(AddressRuleName) == false) { return(false); } if (AssetBundleCollectorSettingData.HasPackRuleName(PackRuleName) == false) { return(false); } if (AssetBundleCollectorSettingData.HasFilterRuleName(FilterRuleName) == false) { return(false); } return(true); }