Skip to content

Commit d5360e7

Browse files
authored
Merge pull request #143 from brunomikoski/feature/uitk-tweaks
Feature/uitk tweaks
2 parents 0fb4b2b + 2e916e3 commit d5360e7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+6022
-286
lines changed

CHANGELOG.MD

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

77
## [Unreleased]
88

9+
## [2.3.1]
10+
### Added
11+
- Added Addressables support again, now you if addressables is available on your project and the collection is set to non auto loaded, and the collection is set to use addressables, will write some helper code on the static file to load the collectiom from the addressables.
12+
- Added a Addressables Sample project as well
13+
- Added Reset Settings context menu option
14+
- Added the Write Addressable Loading Methods toggle for the collection
15+
16+
### Changed
17+
- Updated the visuals of the CollectionEditor again, make it a bit tighter and more readable
18+
- Refactored the settings again _(sorry, some settings will be lost again)_ to make the system more extensible and easier to maintain, settings are now stored inside the .meta files, so it can be versioned but also keep changes between projects
19+
920
## [2.3.0]
1021
### Changed
1122
- Refactored CollectionCustomEditor to use UI Elements, getting rid of multiple hacks to make it work with the IMGUI and Reorderable list
@@ -541,6 +552,7 @@ public bool IsValidConsumable(Consumable consumable)
541552
### Added
542553
- First initial working version
543554

555+
[2.3.1]: https://github.com/badawe/ScriptableObjectCollection/releases/tag/v2.3.1
544556
[2.3.0]: https://github.com/badawe/ScriptableObjectCollection/releases/tag/v2.3.0
545557
[2.2.4]: https://github.com/badawe/ScriptableObjectCollection/releases/tag/v2.2.4
546558
[2.2.3]: https://github.com/badawe/ScriptableObjectCollection/releases/tag/v2.2.3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
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+
<ui:Template name="GroupBoxVisualElement" src="project://database/Packages/com.brunomikoski.scriptableobjectcollection/Editor/UXML/GroupBoxVisualElement.uxml?fileID=9197481963319205126&amp;guid=83f2f2f1ea7e26e45b87253e97a81186&amp;type=3#GroupBoxVisualElement" />
3+
<Style src="project://database/Packages/com.brunomikoski.scriptableobjectcollection/Editor/USS/CollectionStyle.uss?fileID=7433441132597879392&amp;guid=f6040fd5efe6a1e43a9e95760a53fcba&amp;type=3#CollectionStyle" />
4+
<ui:VisualElement name="ContentGroup" view-data-key="content-group" style="flex-grow: 1; margin-top: 0; margin-right: 0; margin-bottom: 0; margin-left: 0;">
5+
<ui:Instance template="GroupBoxVisualElement" name="GroupBoxVisualElement" view-data-key="group-box">
6+
<AttributeOverrides element-name="Label" text="Items" />
7+
<uie:ToolbarSearchField name="ToolbarSearchField" style="width: auto; margin-left: 0; margin-right: 0; margin-top: 0; margin-bottom: 0; padding-bottom: 0; top: -18px; left: 200px; right: 30px; position: absolute;" />
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; position: absolute; right: 0; top: -20px;" />
9+
<ui:ListView virtualization-method="DynamicHeight" show-border="false" 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;" />
10+
</ui:Instance>
11+
<ui:VisualElement name="unity-list-view__footer" class="unity-list-view__footer">
12+
<ui:Button name="unity-list-view__remove-button" text="-" class="unity-text-element unity-button" />
13+
<ui:Button name="unity-list-view__add-button" text="+" class="unity-text-element unity-button" />
14+
</ui:VisualElement>
15+
</ui:VisualElement>
16+
<ui:VisualElement name="BottonGroup">
17+
<ui:Instance template="GroupBoxVisualElement" name="GroupBoxVisualElement">
18+
<ui:VisualElement name="advanced-options-visual-element" style="flex-grow: 1; border-top-left-radius: 0; border-top-right-radius: 0; border-bottom-right-radius: 0; border-bottom-left-radius: 0; padding-top: 10px; padding-right: 10px; padding-bottom: 10px; padding-left: 10px;">
19+
<ui:Toggle label="Automaticaly Loaded" name="automatic-loaded-toggle" binding-path="automaticallyLoaded" tooltip="When enabled, this is automatically loaded by the system when the registry loads from Resources/Addressables. If disabled, it is removed prior to playtime and the reference is deleted from the registry at build time." class="unity-base-field__aligned" style="flex-grow: 0; -unity-font-style: normal;" />
20+
<ui:Toggle label="Write as Partial Class" name="write-partial-class-toggle" tooltip="If enabled, attempts to declare the new static class as partial, allowing direct usage from the same type. This option is disabled when the class or generated file resides in a different assembly." class="unity-base-field__aligned" />
21+
<ui:Toggle label="Use Base Class for Items" name="base-class-for-items-toggle" tooltip="If enabled, this will enforce the use of the base type in the static file declaration, regardless of any objects extending it to a child type." class="unity-base-field__aligned" />
22+
<ui:Toggle label="Enforce Indirect Access" name="enforce-indirect-access" tooltip="Useful if the collection is not auto-loaded, loaded through addressables, or if better memory management is desired. This setting ensures that there are no direct references to the scriptable object." class="unity-base-field__aligned" />
23+
<uie:ObjectField label="Generated Scripts Folde" type="UnityEditor.DefaultAsset, UnityEditor.CoreModule" allow-scene-objects="false" name="generated-scripts-parent-folder" tooltip="Specifies the target folder for generating the static file access. If left null, the file will be generated in the same location as the original file." class="unity-base-field__aligned" />
24+
<ui:TextField picking-mode="Ignore" label="Static Filename" value="filler text" name="static-filename-textfield" is-delayed="true" class="unity-base-field__aligned" />
25+
<ui:TextField picking-mode="Ignore" label="Namespace" value="filler text" name="namespace-textfield" is-delayed="true" class="unity-base-field__aligned" />
26+
<ui:Toggle label="Generate Addressables Loading Methods" name="write-addressables-load-toggle" class="unity-base-field__aligned" />
27+
</ui:VisualElement>
28+
<ui:VisualElement style="flex-grow: 1; flex-direction: row; height: 26px; border-top-left-radius: 0; border-top-right-radius: 0; border-bottom-right-radius: 0; border-bottom-left-radius: 0;">
29+
<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; padding-right: 0; padding-left: -2px; margin-top: 0; margin-right: 0; margin-bottom: 0; margin-left: 0; padding-top: 0; padding-bottom: 0; border-bottom-right-radius: 0; border-bottom-left-radius: 4px; border-top-left-radius: 0; border-top-right-radius: 0;" />
30+
<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; margin-top: 0; margin-right: 0; margin-bottom: 0; margin-left: 0; padding-top: 0; padding-right: 0; padding-bottom: 0; padding-left: 0; border-top-left-radius: 0; border-top-right-radius: 0; border-bottom-right-radius: 0; border-bottom-left-radius: 0;" />
31+
<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; margin-top: 0; margin-right: 0; margin-bottom: 0; margin-left: 0; padding-top: 0; padding-right: 2px; padding-bottom: 0; padding-left: 0; border-top-left-radius: 0; border-top-right-radius: 0; border-bottom-right-radius: 4px; border-bottom-left-radius: 0;" />
32+
</ui:VisualElement>
33+
</ui:Instance>
34+
<ui:Instance template="GroupBoxVisualElement" name="GroupBoxVisualElement">
35+
<AttributeOverrides element-name="Label" text="Default Inspector" enable-rich-text="false" />
36+
<ui:VisualElement name="extra-properties-visual-element" style="flex-grow: 1; margin-top: 0; padding-top: 10px; padding-right: 10px; padding-left: 10px; padding-bottom: 10px; flex-wrap: nowrap; align-items: stretch;">
37+
<ui:IMGUIContainer />
38+
</ui:VisualElement>
39+
</ui:Instance>
40+
</ui:VisualElement>
41+
</ui:UXML>

Editor/UXML/CollectionInspectorTreeAsset.uxml

-52
This file was deleted.

Editor/UXML/CollectionItemTreeAsset.uxml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<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">
22
<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">
3+
<ui:VisualElement name="VisualElement" view-data-key="item-box" 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="false">
55
<ui:IMGUIContainer name="imgui-container" style="margin-top: 0; margin-right: 0; margin-bottom: 0; margin-left: 0; padding-bottom: 0;" />
66
</ui:Foldout>
77
<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;" />

0 commit comments

Comments
 (0)