Unity-SerializeReferenceExtensions icon indicating copy to clipboard operation
Unity-SerializeReferenceExtensions copied to clipboard

[BUG] Reorderable list element can't be dragged

Open Qriva opened this issue 1 year ago • 4 comments

What happened?

Hi, I have array of serializable elements and after upgrading package version (I am pretty sure it worked before) there is no option to drag elements to change order. The reason is foldout arrow in the same position as drag area. obraz

Package Version

1.6.1

Unity Version

2022.3.21

Qriva avatar Nov 23 '24 14:11 Qriva

Hi. It looks different from my environment. Are you using an editor extension? Below is a rendering in 2022.3.21f1 in my environment. image It would also be helpful if you could attach a screenshot of the entire SubclassSelector as drawn in the Inspector.

mackysoft avatar Nov 24 '24 04:11 mackysoft

I don't think there is custom drawer or editor that would affect rendering of this arrow. I made separate serializable class to test with new component and I have got the same result, everything is rendered correctly except foldout arrow. GIF 24 11 2024 15-57-49 So the last thing in my mind that could possibly cause this bug in my project is NaughtyAttributes package.

My test code:

public class PlaneTest : MonoBehaviour
{
    [SerializeReference, SubclassSelector] public TestConfig[] configurations;
}

[System.Serializable]
public abstract class TestConfig
{
    public abstract float Speed { get; }

    public abstract void Execute();
}

[System.Serializable]
public class FirstConfig : TestConfig
{
    public float damage = 1f;
    public float knockback = 0f;

    public override float Speed => 1f;

    public override void Execute()
    {
    }
}

Qriva avatar Nov 24 '24 15:11 Qriva

I have the same problem.

Image

Commenting out the following code solved the problem.

https://github.com/mackysoft/Unity-SerializeReferenceExtensions/blob/main/Assets/MackySoft/MackySoft.SerializeReferenceExtensions/Editor/SubclassSelectorDrawer.cs#L85

Image

Package version: 1.6.1 Unity version: 2022.3.42f1, 2022.3.21f1 (mac apple silicon)

naoya-maeda avatar Apr 04 '25 05:04 naoya-maeda

It's broken in 2022.3, but after upgrading to unity 6 it works properly. However in case you can't upgrade, it's still possible to move element if you drag by left edge - the first pixel of element.

Qriva avatar Apr 04 '25 11:04 Qriva