gasgiant / Markup-Attributes

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

Multiple inheritance needed #23

Open Ilario1942 opened 2 months ago

Ilario1942 commented 2 months ago

Hello hello! I've got a small issue...

To use MarkupAttributes on my own script, for example with your HorizontalGroup, I have to change its inheritance class, like here:

 'MyScript : MonoBehaviour to MyScript : SamplesBehaviour'

But, I've got some attributes that are in an other inheritance class, and I can't do this:

 'MyScript : MonoBehaviour to MyScript : CustomBehaviour, SamplesBehaviour'

Because C# doesn't have multiple inheritance. How can I use your MarkupAttributes and some other classes attributes in the same script, if it's possible?

Thank you a lot for the work tho! <3

EDIT:

Maybe I can do this:

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

Like you said in your README, and only set this:

 'MyScript : CustomBehaviour'

And I suppose that if I have another type of inheritance class that I need, I'll just need to add an other custom editor, like this:

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

 [CustomEditor(typeof(MonoBehaviour), true), CanEditMultipleObjects]
 internal class CustomMonoBehaviourEditor : MyCustomEditor
 {
 }'

Is it the solution to the main issue?

Ilario