From ef1acdc3d1e118dae3354ec87bfaca5824a9a64b Mon Sep 17 00:00:00 2001 From: hevinci Date: Tue, 11 Oct 2022 11:08:22 +0800 Subject: [PATCH] Update extension code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复了在未初始化之前查看是否初始化报空异常的错误。 --- Assets/YooAsset/Runtime/YooAssetsExtension.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Assets/YooAsset/Runtime/YooAssetsExtension.cs b/Assets/YooAsset/Runtime/YooAssetsExtension.cs index 5d3d9fd..4abf39f 100644 --- a/Assets/YooAsset/Runtime/YooAssetsExtension.cs +++ b/Assets/YooAsset/Runtime/YooAssetsExtension.cs @@ -15,7 +15,12 @@ namespace YooAsset /// public static bool IsInitialized { - get { return _mainPackage.IsInitialized; } + get + { + if (_mainPackage == null) + return false; + return _mainPackage.IsInitialized; + } } ///