Skip to content
This repository was archived by the owner on Dec 2, 2023. It is now read-only.
This repository was archived by the owner on Dec 2, 2023. It is now read-only.

Nested serializable class can't be serialized.  #7

@Nu99et

Description

@Nu99et

Type in use (some code is omitted)

public abstract class View<TBinding>
{
     [SerializeField] private TBinding binding;
    protected TBinding Binding => binding;
}

public class MyView : View<MyView.MyBinding>
{
    [Serializable]
    public class MyBinding
    {
        public Text text;
    }
}

When the package is removed, this type could be serialized well.

Stacktrace

NullReferenceException: Object reference not set to an instance of an object
AnnulusGames.LucidTools.Editor.SerializedPropertyExtensions.GetFieldInfo (UnityEditor.SerializedProperty property) (at ./Library/PackageCache/com.annulusgames.lucid-editor@3747d977e2/Editor/Extensions/SerializedPropertyExtensions.cs:154)
AnnulusGames.LucidTools.Editor.InspectorPropertyUtil.CreateChildProperties (AnnulusGames.LucidTools.Editor.InspectorField property) (at ./Library/PackageCache/com.annulusgames.lucid-editor@3747d977e2/Editor/Utils/InspectorPropertyUtil.cs:38)
AnnulusGames.LucidTools.Editor.InspectorField.InitializeChildProperties () (at ./Library/PackageCache/com.annulusgames.lucid-editor@3747d977e2/Editor/InspectorProperty/InspectorField.cs:80)
AnnulusGames.LucidTools.Editor.InspectorField..ctor (UnityEditor.SerializedProperty property, System.Attribute[] attributes) (at ./Library/PackageCache/com.annulusgames.lucid-editor@3747d977e2/Editor/InspectorProperty/InspectorField.cs:62)
AnnulusGames.LucidTools.Editor.InspectorPropertyUtil.CreateChildProperties (AnnulusGames.LucidTools.Editor.InspectorField property) (at ./Library/PackageCache/com.annulusgames.lucid-editor@3747d977e2/Editor/Utils/InspectorPropertyUtil.cs:49)
AnnulusGames.LucidTools.Editor.InspectorField.InitializeChildProperties () (at ./Library/PackageCache/com.annulusgames.lucid-editor@3747d977e2/Editor/InspectorProperty/InspectorField.cs:80)
AnnulusGames.LucidTools.Editor.InspectorField..ctor (UnityEditor.SerializedProperty property, System.Attribute[] attributes) (at ./Library/PackageCache/com.annulusgames.lucid-editor@3747d977e2/Editor/InspectorProperty/InspectorField.cs:62)
AnnulusGames.LucidTools.Editor.InspectorPropertyUtil.CreatePropertyField (UnityEditor.SerializedProperty serializedProperty) (at ./Library/PackageCache/com.annulusgames.lucid-editor@3747d977e2/Editor/Utils/InspectorPropertyUtil.cs:15)
AnnulusGames.LucidTools.Editor.InspectorPropertyUtil.CreateProperties (UnityEditor.SerializedObject serializedObject) (at ./Library/PackageCache/com.annulusgames.lucid-editor@3747d977e2/Editor/Utils/InspectorPropertyUtil.cs:26)
AnnulusGames.LucidTools.Editor.LucidEditor.InitializeProperties () (at ./Library/PackageCache/com.annulusgames.lucid-editor@3747d977e2/Editor/LucidEditor.cs:45)
AnnulusGames.LucidTools.Editor.LucidEditor.OnInspectorGUI () (at ./Library/PackageCache/com.annulusgames.lucid-editor@3747d977e2/Editor/LucidEditor.cs:30)
UnityEditor.UIElements.InspectorElement+<>c__DisplayClass72_0.<CreateInspectorElementUsingIMGUI>b__0 () (at <5909001d89834f35ba5cf7792a7cc442>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions