[英]Unity psb file import null reference
So I just wanted to import my 2d character into unity and when I drag the PSB file into unity.所以我只想将我的 2d 角色导入统一,当我将 PSB 文件拖入统一时。 It just gives me this error:
它只是给了我这个错误:
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&)
I found the solution!!!我找到了解决方案!!! you can close the platform settings of the PSD import error that is causing the problem
您可以关闭导致问题的 PSD 导入错误的平台设置
Create a C# script called FixPSDImporter
and paste this inside and fixed!创建一个名为
FixPSDImporter
的 C# 脚本并将其粘贴到内部并修复!
public static class FixPSDImporter
{
[UnityEditor.InitializeOnLoadMethod]
public static void ResetPSDImporterFoldout()
{
UnityEditor.EditorPrefs.DeleteKey("PSDImporterEditor.m_PlatformSettingsFoldout");
}
}
Solution found here: https://forum.unity.com/threads/psb-asset-inspector-window-is-breaking.1334079/解决方案在这里找到: https://forum.unity.com/threads/psb-asset-inspector-window-is-break.1334079/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.