我已经在今年的开始就开始打造这个框架了,它还没有准备好,但我对它的表现很满意,而且工作起来很方便。

例如,这是用来渲染建筑物的代码:

<ui:VisualElement name="surface" class="sc-fauxmap__surface" on-click="OnSurfaceClick($event)">
    <uf:For items="{{ Buildings }}" key="item.Id">
        <CriminalMakers.BuildingMarker building="{{ item }}" />
    </uf:For>
</ui:VisualElement>

下面是 Buildings 窗口的代码:

<ui:ScrollView class="bw-body">

    <!-- 区域 -->
    <ui:VisualElement class="bw-section">
        <ui:Label class="bw-section-title" text="区域 ({{ ZoneBuildings.Count }})" />
        <ui:Label class="bw-empty" if="{{ ZoneBuildings.Count == 0 }}" text="暂无" />
        <ui:VisualElement for="b of ZoneBuildings" key="b.Id" class="bw-row"
                          on-click="store.Select(b)"
                          class-selected="{{ store.Selected.Value == b }}">
            <ui:Label class="bw-row-glyph" text="{{ GlyphFor(b.Type) }}" />
            <ui:Label class="bw-row-name" text="{{ b.Name }}" />
            <ui:Label class="bw-row-meta" text="Lv {{ b.Level }} · {{ b.Population }}" />
        </ui:VisualElement>
    </ui:VisualElement>

我正在考虑将其上传到 Asset Store 中。

你们的意见是什么?