You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Unity导入PSB文件触发NullReferenceException空引用错误求助

PSB文件导入Unity触发空引用异常的解决方法

问题现象

将2D角色PSB文件拖入Unity时,出现以下空引用异常:

NullReferenceException: Max Size: SerializedProperty is null
UnityEditor.EditorGUI.BeginPropertyInternal (UnityEngine.Rect totalPosition, UnityEngine.GUIContent label, UnityEditor.SerializedProperty property) (at <0d6ce211ebbc47e1a35a84c3672ff58f>:0)
UnityEditor.EditorGUI.BeginProperty (UnityEngine.Rect totalPosition, UnityEngine.GUIContent label, UnityEditor.SerializedProperty property) (at <0d6ce211ebbc47e1a35a84c3672ff58f>:0)
UnityEditor.Modules.DefaultTextureImportSettingsExtension.ShowImportSettings (UnityEditor.BaseTextureImportPlatformSettings editor) (at <0d6ce211ebbc47e1a35a84c3672ff58f>:0)
UnityEditor.BaseTextureImportPlatformSettings.ShowPlatformSpecificSettings (System.Collections.Generic.List`1[T] platformSettings, System.Int32 selected) (at <0d6ce211ebbc47e1a35a84c3672ff58f>:0)
UnityEditor.U2D.Common.TexturePlatformSettingsHelper.ShowPlatformSpecificSettings () (at Library/PackageCache/com.unity.2d.common@6.0.3/Editor/InternalBridge/TexturePlatformSettings/TexturePlatformSettings.cs:158)
UnityEditor.U2D.PSD.PSDImporterEditor.DoPlatformSettings () (at Library/PackageCache/com.unity.2d.psdimporter@6.0.4/Editor/PSDImporterEditor.cs:419)
UnityEditor.U2D.PSD.PSDImporterEditor.DoSettingsUI () (at Library/PackageCache/com.unity.2d.psdimporter@6.0.4/Editor/PSDImporterEditor.cs:274)
UnityEditor.U2D.PSD.PSDImporterEditor.OnInspectorGUI () (at Library/PackageCache/com.unity.2d.psdimporter@6.0.4/Editor/PSDImporterEditor.cs:232)
UnityEditor.UIElements.InspectorElement+<>c__DisplayClass59_0.<CreateIMGUIInspectorFromEditor>b__0 () (at <122642d41668428d845063b1753c4e72>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)

错误界面截图:
错误界面截图

解决方法

  • 检查并更新2D相关包版本:打开Package Manager,找到com.unity.2d.psdimporter和com.unity.2d.common,确保版本与当前Unity版本兼容。如果版本过旧,更新到推荐版本;如果是新版本出现问题,回退到稳定版。
  • 重置PSB文件导入设置:选中报错的PSB文件,在Inspector面板底部点击Reset按钮,或者右键选择Reimport重新导入文件。
  • 清理Library缓存:关闭Unity,删除项目根目录下的Library文件夹,重新打开Unity等待缓存重建完成后再尝试导入。
  • 验证PSB文件完整性:用Photoshop打开该PSB文件,检查是否有损坏的图层、通道或异常结构,重新保存后再导入Unity。
  • 排查项目配置问题:创建一个新的空白Unity项目,导入同一个PSB文件,如果能正常导入,说明原项目存在配置异常,可尝试迁移资源到新项目。

内容的提问来源于stack exchange,提问作者Hebele Hübele

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.19 11:31:00