SubjectNerd-Unity / ReorderableInspector

Automatic reorderable lists for Unity game engine components
MIT License
485 stars 47 forks source link

Other fields become readonly #6

Open arnaud-jamin opened 6 years ago

arnaud-jamin commented 6 years ago

Hello,

Nice library. It seems to work fine on most cases but I encounter an issue making all the other fields readonly: image

When I remove the reoderable attribute the fields become enabled: image

My class is a scriptable object:

    [Serializable]
    public class SpellNode : ScriptableObject
    {
        [Reorderable]
        [SerializeField]
        protected List<SpellSlotType> m_slotDefinition = null;

        [Header("General")]
        [SerializeField]
        protected string m_guid = string.Empty;

        [SerializeField]
        protected Sprite m_icon = null;

        [SerializeField]
        protected string m_name = string.Empty;

        [SerializeField]
        [TextArea]
        protected string m_rawDescription = string.Empty;

I tried uncommenting this, but it has no effect #define EDIT_ALL_SCRIPTABLES

Thanks!

ChemiKhazi commented 5 years ago

I have limited time to work on this repo, but this is a legitimate issue. I'll see if I can address this when I have time to work on it.

Hivemind9000 commented 5 years ago

I'm having the same issue. To circumvent it for now you need to change the following in ReorderableArrayInspector.cs (~line 733):

bool isStartProp = targetProp.propertyPath.StartsWith("m_");
using (new EditorGUI.DisabledScope(isStartProp))
{
    EditorGUILayout.PropertyField(targetProp, targetProp.isExpanded);
}

to

bool isStartProp = false;
using (new EditorGUI.DisabledScope(isStartProp))
{
    EditorGUILayout.PropertyField(targetProp, targetProp.isExpanded);
}

I'm not sure why this code is here, but it doesn't seem to affect anything by making this change.