Closed rakkarage closed 6 years ago
there must be some way to make it work in this situation please?
works like this in odin
using Sirenix.OdinInspector.Editor;
using UnityEngine;
using UnityEditor;
public class OdinBrush : GridBrushEditor
{
OdinEditor editor;
private void OnGUI()
{
if (!editor)
editor = Editor.CreateEditor(target, typeof(OdinEditor)) as OdinEditor;
editor.OnInspectorGUI();
}
}
is there a comparable way to get this working from classed that cannot derive from this? thanks
yes, thanks
using System;
using UnityEngine;
using UnityEngine.Tilemaps;
using SubjectNerd.Utilities;
#if UNITY_EDITOR
using UnityEditor;
#endif
[CreateAssetMenu]
[Serializable]
public class TestB : ScriptableObject
{
public int[] Test;
public TileOrientation Orientation;
}
#if UNITY_EDITOR
[CustomEditor(typeof(TestB))]
public class TestBEditor : Editor
{
ReorderableArrayInspector editor;
public override void OnInspectorGUI()
{
if (!editor)
editor = Editor.CreateEditor(target, typeof(ReorderableArrayInspector)) as ReorderableArrayInspector;
editor.OnInspectorGUI();
}
}
#endif
I must already derive from GridBrushEditor (tho i not use any GUI) so I cannot derive from ReorderableArrayInspector!? Why does my CustomPropertyDrawer work in this situation but not Reorderable? Is there any way to make it work? I need to make a custom drawer or a ReorderableArrayInspector Thanks.
https://en.wikipedia.org/wiki/Composition_over_inheritance
edit:
If not auto then how please? tried [Reorderable]...