SubjectNerd-Unity / ReorderableInspector

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

[Reorderable] not working from GridBrushEditor [Unity 2018] #4

Closed rakkarage closed 6 years ago

rakkarage commented 6 years ago

hi. thanks for this excellent project i am having some trouble getting it to work from GridBrushEditor

Custom inspectors will not automatically draw arrays as ReorderableLists unless they inherit from ReorderableArrayInspector.

i made this simple test project. in the real project i have more code in GridBrushEditor https://github.com/rakkarage/TestReorderableInspector

any way to get working? thanks

rakkarage commented 6 years ago

also: i made a custom PropertyDrawer for an Enum and it displays in there... so why would this not

rakkarage commented 6 years ago

Ensure all related classes are in file matching class name https://forum.unity.com/threads/how-to-use-custom-property-drawers-in-a-scriptableobject-inspector.245414/ sorry & thanks

rakkarage commented 6 years ago

i had removed the OnGUI overrides but had not removed the CustomEditorAttribute from brush

using System;
using UnityEngine;
using UnityEngine.Tilemaps;
namespace UnityEditor
{
    // [CustomEditor(typeof(RandomBrush))]
    public class RandomBrushEditor : GridBrushEditor
    {
        public override void PaintPreview(GridLayout gridLayout, GameObject brushTarget, Vector3Int position)
        {
            Debug.Log("TEST!");
        }
    }
}
rakkarage commented 6 years ago

if i remove thar attribute it works in inspector and paint inspector because does not use this class at all but i need to use this attribute to link this other non gui related (preview etc) code to the brush so i use DrawDefaultInspector

it works for my CustomPropertyDrawer for enum flags but does not work for ReorderableInspector?

is there any way to make it show ReorderableInspector for RandomTile AND RandomBrush? thanks

https://github.com/rakkarage/TestReorderableInspector