Closed Bmirproject closed 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?
In conclusion, I want to make something that puts a button function in a method as an attribute.
Hi! There is no attribute for adding a button for a method currently. I'll consider adding it in the future.
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;
}
but....
not delete that code, its not worked.
How can I create custom attributes?