Skip to content

Commit 0fb4b2b

Browse files
authored
Merge pull request #142 from brunomikoski/feature/ui-toolkit
Feature/UI toolkit
2 parents ad97d6f + 334c738 commit 0fb4b2b

30 files changed

+1057
-1122
lines changed

CHANGELOG.MD

+24-2
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,33 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## [Unreleased]
88

9+
## [2.3.0]
10+
### Changed
11+
- Refactored CollectionCustomEditor to use UI Elements, getting rid of multiple hacks to make it work with the IMGUI and Reorderable list
12+
- Updated the visuals of the Collection Editor
13+
- Advanced Options are now exposed by default, giving more clarify of what is going on
14+
- Removed the editor only assets from the Collection (`generateAsPartialClass`, `generateAsBaseClass`, `generateAsStaticClass`), those are not stored on the SOCSettings file and versioned
15+
- The `guid`, `items` and `automaticallyLoaded` are now `HideInInspector` on the Collection, to avoid confusion
16+
- Added new USS and UXML files to the Collection Editor
17+
- Generated static files now contains the default `.g.cs` postfix
18+
- If you set your Default Folder for Generated Files to null on the settings, it will now use the same folder as the original collection .cs files.
19+
- If you now set your namespace to empty on the settings, it will now use the same namespace as the original collection .cs files.
20+
- Add new Context Menu on the Collection to generate the indirect file for the collection
21+
- Fixed GoTo button not working on the PropertyDrawer, now will probably select the collection and expand only the item you want.
22+
23+
### Added
24+
- Added new Default Inspector session to the Collection Editor, where you can see the default inspector of the collection and expose more items there.
25+
- Collections now can be enforced to use Indirect Reference, this will show an error message if the collection is not using Indirect Reference
26+
27+
### Know issues
28+
- Settings will not be automatically converted to the new SOCSettings file, settings like _(custom namespace, filename, or target folder)_ so you have to reconfigure those settings manually
29+
930
## [2.2.4]
1031
### Added
11-
* Added Item Order Protection. Override the `ShouldProtectItemOrder` property in your Collection to disallow items being dragged or deleted.
32+
- Added Item Order Protection. Override the `ShouldProtectItemOrder` property in your Collection to disallow items being dragged or deleted.
1233

1334
### Fixed
14-
* Fixed SOC Item property drawers not working in certain Unity versions by @RoyTheunissen in https://github.com/brunomikoski/ScriptableObjectCollection/pull/141
35+
- Fixed SOC Item property drawers not working in certain Unity versions by @RoyTheunissen in https://github.com/brunomikoski/ScriptableObjectCollection/pull/141
1536

1637
## [2.2.3]
1738
### Fixed
@@ -520,6 +541,7 @@ public bool IsValidConsumable(Consumable consumable)
520541
### Added
521542
- First initial working version
522543

544+
[2.3.0]: https://github.com/badawe/ScriptableObjectCollection/releases/tag/v2.3.0
523545
[2.2.4]: https://github.com/badawe/ScriptableObjectCollection/releases/tag/v2.2.4
524546
[2.2.3]: https://github.com/badawe/ScriptableObjectCollection/releases/tag/v2.2.3
525547
[2.2.2]: https://github.com/badawe/ScriptableObjectCollection/releases/tag/v2.2.2

Editor.meta

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Editor/USS.meta

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Editor/USS/CollectionStyle.uss

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#header-foldout .unity-label {
2+
-unity-font-style: bold;
3+
flex-grow: 1;
4+
}
5+
6+
#header-foldout #unity-content {
7+
margin-bottom: 10px;
8+
}
9+
10+
#ContentGroup ScrollView {
11+
border-top-left-radius: 0;
12+
border-top-right-radius: 0;
13+
}
14+
15+
#rename-text-field #unity-text-input {
16+
border-left-color: rgba(0, 0, 0, 0);
17+
border-right-color: rgba(0, 0, 0, 0);
18+
border-top-color: rgba(0, 0, 0, 0);
19+
border-bottom-color: rgba(0, 0, 0, 0);
20+
border-top-width: 0;
21+
border-right-width: 0;
22+
border-bottom-width: 0;
23+
border-left-width: 0;
24+
background-color: rgba(255, 255, 255, 0);
25+
}

Editor/USS/CollectionStyle.uss.meta

+11
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Editor/UXML.meta

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements" xsi="http://www.w3.org/2001/XMLSchema-instance" engine="UnityEngine.UIElements" editor="UnityEditor.UIElements" noNamespaceSchemaLocation="../../../../UIElementsSchema/UIElements.xsd" editor-extension-mode="True">
2+
<Style src="project://database/Packages/com.brunomikoski.scriptableobjectcollection/Editor/USS/CollectionStyle.uss?fileID=7433441132597879392&amp;guid=f6040fd5efe6a1e43a9e95760a53fcba&amp;type=3#CollectionStyle" />
3+
<ui:VisualElement name="HeaderGroup" style="flex-grow: 0; padding-bottom: 10px; padding-top: 4px;" />
4+
<ui:VisualElement name="ContentGroup" style="flex-grow: 1; margin-top: 0; margin-right: 0; margin-bottom: 0; margin-left: 0;">
5+
<ui:VisualElement name="VisualElement" style="flex-grow: 1; margin-top: 0; margin-right: 0; margin-bottom: 0; margin-left: 0; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 0; border-left-width: 1px; border-left-color: rgb(32, 32, 32); border-right-color: rgb(32, 32, 32); border-top-color: rgb(32, 32, 32); border-bottom-color: rgb(32, 32, 32); padding-top: 2px; padding-right: 2px; padding-bottom: 0; padding-left: 4px; font-size: 12px; border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 0; border-bottom-left-radius: 0; background-color: rgb(48, 48, 48); flex-direction: row;">
6+
<ui:Label tabindex="-1" text="Items" parse-escape-sequences="true" display-tooltip-when-elided="true" style="-unity-font-style: bold; font-size: 12px;" />
7+
<ui:VisualElement style="flex-grow: 1; flex-direction: row; justify-content: flex-end;">
8+
<ui:Button parse-escape-sequences="true" display-tooltip-when-elided="true" name="expand-button" tooltip="Expand / Collapse Items" text="↓ " enable-rich-text="false" style="width: 18px; height: 18px;" />
9+
<ui:Button parse-escape-sequences="true" display-tooltip-when-elided="true" name="sort-button" style="width: 18px; height: 18px; display: none;" />
10+
</ui:VisualElement>
11+
</ui:VisualElement>
12+
<uie:ToolbarSearchField name="ToolbarSearchField" style="width: auto; margin-left: 0; margin-right: 0; margin-top: 0; margin-bottom: 0; padding-bottom: 0; top: 4px; left: 200px; right: 30px; position: absolute;" />
13+
<ui:ListView virtualization-method="DynamicHeight" show-border="true" show-alternating-row-backgrounds="All" reorderable="true" show-foldout-header="false" header-title="Items" show-add-remove-footer="false" reorder-mode="Animated" show-bound-collection-size="false" name="items-list-view" horizontal-scrolling="false" selection-type="Single" view-data-key="collection-item-list-view" style="display: flex;" />
14+
<ui:VisualElement name="unity-list-view__footer" class="unity-list-view__footer">
15+
<ui:Button name="unity-list-view__remove-button" text="-" class="unity-text-element unity-button" />
16+
<ui:Button name="unity-list-view__add-button" text="+" class="unity-text-element unity-button" />
17+
</ui:VisualElement>
18+
</ui:VisualElement>
19+
<ui:VisualElement name="BottonGroup">
20+
<ui:VisualElement style="flex-grow: 1; flex-direction: column;">
21+
<ui:Button text="Generate Static File" parse-escape-sequences="true" display-tooltip-when-elided="true" tooltip="Uses Code Generation to generate the Static File to access collection items by code." name="generate-static-file-button" style="flex-grow: 1;" />
22+
<ui:Button text="Synchronize Assets" parse-escape-sequences="true" display-tooltip-when-elided="true" tooltip="Check for invalid references and reload found items into the collection" name="synchronize-items-button" style="flex-grow: 1;" />
23+
</ui:VisualElement>
24+
<ui:VisualElement style="flex-grow: 1; flex-direction: row; margin-top: 20px;">
25+
<ui:Button text="Generate Items" parse-escape-sequences="true" display-tooltip-when-elided="true" tooltip="Uses Code Generation to generate the Static File to access collection items by code." name="generate-auto-items" style="flex-grow: 1; min-height: 60px;" />
26+
</ui:VisualElement>
27+
<ui:VisualElement name="DefaultGroupBox">
28+
<ui:VisualElement name="VisualElement" style="flex-grow: 1; margin-top: 20px;">
29+
<ui:VisualElement name="advanced-header-visual-element" style="flex-grow: 1; margin-top: 0; margin-right: 0; margin-bottom: 0; margin-left: 0; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-left-color: rgb(32, 32, 32); border-right-color: rgb(32, 32, 32); border-top-color: rgb(32, 32, 32); border-bottom-color: rgb(32, 32, 32); padding-top: 2px; padding-right: 2px; padding-bottom: 2px; padding-left: 4px; font-size: 12px; border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 0; border-bottom-left-radius: 0; background-color: rgb(48, 48, 48);">
30+
<ui:Label tabindex="-1" text="Advanced" parse-escape-sequences="true" display-tooltip-when-elided="true" name="Label" style="-unity-font-style: bold; font-size: 12px;" />
31+
</ui:VisualElement>
32+
<ui:VisualElement style="flex-grow: 1; border-left-color: rgb(32, 32, 32); border-right-color: rgb(32, 32, 32); border-top-color: rgb(32, 32, 32); border-bottom-color: rgb(32, 32, 32); border-top-width: 0; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-left-radius: 0; border-top-right-radius: 0; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; margin-top: 0; padding-top: 10px; padding-right: 10px; padding-left: 10px; padding-bottom: 10px; flex-wrap: nowrap; align-items: stretch;">
33+
<ui:Toggle label="Automaticaly Loaded" name="automatic-loaded-toggle" binding-path="automaticallyLoaded" class="unity-base-field__aligned" style="flex-grow: 0; -unity-font-style: normal;" />
34+
<ui:Toggle label="Write as Partial Class" name="write-partial-class-toggle" class="unity-base-field__aligned" />
35+
<ui:Toggle label="Use Base Class for Items" name="base-class-for-items-toggle" class="unity-base-field__aligned" />
36+
<ui:Toggle label="Enforce Indirect Access" name="enforce-indirect-access" tooltip="Useful if this collections is not auto loaded, or loaded through addressables, or you just want to have better memory management" class="unity-base-field__aligned" />
37+
<uie:ObjectField label="Generated Scripts Folde" type="UnityEditor.DefaultAsset, UnityEditor.CoreModule" allow-scene-objects="false" name="generated-scripts-parent-folder" class="unity-base-field__aligned" />
38+
<ui:TextField picking-mode="Ignore" label="Static Filename" value="filler text" name="static-filename-textfield" is-delayed="true" class="unity-base-field__aligned" />
39+
<ui:TextField picking-mode="Ignore" label="Namespace" value="filler text" name="namespace-textfield" is-delayed="true" class="unity-base-field__aligned" />
40+
</ui:VisualElement>
41+
</ui:VisualElement>
42+
</ui:VisualElement>
43+
<ui:VisualElement name="extra-properties-visual-element" style="flex-grow: 1; margin-top: 20px;">
44+
<ui:VisualElement name="advanced-header-visual-element" style="flex-grow: 1; margin-top: 0; margin-right: 0; margin-bottom: 0; margin-left: 0; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-left-color: rgb(32, 32, 32); border-right-color: rgb(32, 32, 32); border-top-color: rgb(32, 32, 32); border-bottom-color: rgb(32, 32, 32); padding-top: 2px; padding-right: 2px; padding-bottom: 2px; padding-left: 4px; font-size: 12px; border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 0; border-bottom-left-radius: 0; background-color: rgb(48, 48, 48);">
45+
<ui:Label tabindex="-1" text="Default Inspector" parse-escape-sequences="true" display-tooltip-when-elided="true" name="Label" style="-unity-font-style: bold; font-size: 12px;" />
46+
</ui:VisualElement>
47+
<ui:VisualElement style="flex-grow: 1; border-left-color: rgb(32, 32, 32); border-right-color: rgb(32, 32, 32); border-top-color: rgb(32, 32, 32); border-bottom-color: rgb(32, 32, 32); border-top-width: 0; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-left-radius: 0; border-top-right-radius: 0; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; margin-top: 0; padding-top: 10px; padding-right: 10px; padding-left: 10px; padding-bottom: 10px; flex-wrap: nowrap; align-items: stretch;">
48+
<ui:IMGUIContainer />
49+
</ui:VisualElement>
50+
</ui:VisualElement>
51+
</ui:VisualElement>
52+
</ui:UXML>

Editor/UXML/CollectionInspectorTreeAsset.uxml.meta

+10
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements" xsi="http://www.w3.org/2001/XMLSchema-instance" engine="UnityEngine.UIElements" editor="UnityEditor.UIElements" noNamespaceSchemaLocation="../../../../UIElementsSchema/UIElements.xsd" editor-extension-mode="True">
2+
<Style src="project://database/Packages/com.brunomikoski.scriptableobjectcollection/Editor/USS/CollectionStyle.uss?fileID=7433441132597879392&amp;guid=f6040fd5efe6a1e43a9e95760a53fcba&amp;type=3#CollectionStyle" />
3+
<ui:VisualElement name="VisualElement" style="flex-grow: 1; padding-top: 0; padding-right: 0; padding-bottom: 0; padding-left: 0; margin-top: 0; margin-right: 0; margin-bottom: 0; margin-left: 0;">
4+
<ui:Foldout name="header-foldout" text="Title" value="true">
5+
<ui:IMGUIContainer name="imgui-container" style="margin-top: 0; margin-right: 0; margin-bottom: 0; margin-left: 0; padding-bottom: 0;" />
6+
</ui:Foldout>
7+
<ui:TextField picking-mode="Ignore" value="Default Endless" name="rename-text-field" is-delayed="true" style="display: none; position: absolute; flex-grow: 1; top: 0; width: 100%; background-color: rgba(0, 0, 0, 0); -unity-font-style: bold; margin-left: 0; left: 2px; overflow: visible; visibility: visible;" />
8+
</ui:VisualElement>
9+
</ui:UXML>

Editor/UXML/CollectionItemTreeAsset.uxml.meta

+10
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)