Skip to content

Serializable class #16

@chebedzic

Description

@chebedzic

Hey there,

Amazing plugin and I'm really happy with it.

I've managed to create an Array 2d of custom scriptable object classes, but I have a problem if I try to create Array2d of a serializable class.

Basically is this possible?



[Serializable]
public class Array2DTest : Array2D<Test>

[Serializable]
public class Test

[CustomPropertyDrawer(typeof(Array2DTest))]
    public class Array2DTestDrawer : Array2DDrawer
    {
        protected override object GetDefaultCellValue() => new Test();

        protected override object GetCellValue(SerializedProperty cell) => cell.managedReferenceValue;
        protected override void SetValue(SerializedProperty cell, object obj)
        {
            cell.managedReferenceValue = (Test) obj;
        }
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions