ex-makina / marklight

MarkLight is a presentation framework for Unity that allows you to create scene elements in a language similar to HTML.
MIT License
75 stars 35 forks source link

Allow replacement view models to define xsd schema #11

Closed jholland918 closed 4 years ago

jholland918 commented 6 years ago

When using the ReplacesViewModel attribute I've noticed the xsd schema didn't update to reflect my extra fields in intellisense after I clicked the Generate Schema button on the View Presenter component in the Inspector.

Consider the following code:

namespace MarkLight.Views.UI
{
    [ReplacesViewModel("Label")]
    class MyLabel : Label
    {
        public string MyCustomField;
    }
}

<Label Text="Some Text" MyCustomField="MyCustomData" />

When adding the MyCustomField attribute the intellisense did not provide this attribute as an option. So this pull request fixes the issue by skipping all view models that are replaced and then lets the replacement view models define the xsd schema.