gasgiant / Markup-Attributes

A Unity Editor extension for customizing inspector layout with attributes.
MIT License
289 stars 11 forks source link

I cannot use custom attributes. #13

Closed Bmirproject closed 2 years ago

Bmirproject commented 2 years ago

In my opinion, Markup controls all Monobehaviors. Therefore, it prevents me from creating my own custom Attribute. How can I create custom attributes?

I delete below,

[CustomEditor(typeof(MonoBehaviour), true), CanEditMultipleObjects] internal class MarkedUpMonoBehaviourEditor : MarkedUpEditor { }

below code is worked.

[CustomEditor(typeof(ButtonAttribute), true)] internal class ButtonPropertyDrawer : MarkedUpEditor { private ButtonsDrawer _buttonDrawer;

private new void OnEnable()
{
    _buttonDrawer = new ButtonsDrawer(target);
}

public override void OnInspectorGUI()
{
    base.OnInspectorGUI();
    _buttonDrawer.DrawButtons(targets);
}

}

but....

not delete that code, its not worked.

How can I create custom attributes?

Bmirproject commented 2 years ago

In conclusion, I want to make something that puts a button function in a method as an attribute.

gasgiant commented 2 years ago

Hi! There is no attribute for adding a button for a method currently. I'll consider adding it in the future.