Hebele Hübele
Hebele Hübele

Reputation: 103

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. 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/[email protected]/Editor/InternalBridge/TexturePlatformSettings/TexturePlatformSettings.cs:158)
UnityEditor.U2D.PSD.PSDImporterEditor.DoPlatformSettings () (at Library/PackageCache/[email protected]/Editor/PSDImporterEditor.cs:419)
UnityEditor.U2D.PSD.PSDImporterEditor.DoSettingsUI () (at Library/PackageCache/[email protected]/Editor/PSDImporterEditor.cs:274)
UnityEditor.U2D.PSD.PSDImporterEditor.OnInspectorGUI () (at Library/PackageCache/[email protected]/Editor/PSDImporterEditor.cs:232)
UnityEditor.UIElements.InspectorElement+<>c__DisplayClass59_0.<CreateIMGUIInspectorFromEditor>b__0 () (at <122642d41668428d845063b1753c4e72>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)

enter image description here

Upvotes: 0

Views: 1336

Answers (1)

Eric Valero
Eric Valero

Reputation: 590

I found the solution!!! you can close the platform settings of the PSD import error that is causing the problem

Create a C# script called FixPSDImporter and paste this inside and fixed!

 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/

Upvotes: 1

Related Questions