From f4c0ccf541e2d1327599853424f76ddb240c9147 Mon Sep 17 00:00:00 2001 From: Joni Savolainen Date: Thu, 12 May 2022 09:23:50 +0300 Subject: [PATCH] feat: add samples --- .github/workflows/upm.yml | 4 +++ .../AssetGroups/Default Local Group.asset | 8 +++--- Assets/Examples/Editor.meta | 3 --- .../AssetDatabaseExampleComponentWindow.cs | 23 ------------------ ...ssetDatabaseExampleComponentWindow.cs.meta | 3 --- .../Editor/LoadFromAssetDatabase.meta | 8 ------ .../AssetDatabaseExampleComponent.cs | 11 --------- .../AssetDatabaseExampleComponent.cs.meta | 3 --- .../AssetDatabaseExampleComponent.uss | 8 ------ .../AssetDatabaseExampleComponent.uss.meta | 3 --- .../AssetDatabaseExampleComponent.uxml | 6 ----- .../AssetDatabaseExampleComponent.uxml.meta | 3 --- .../UIComponentsExamples.Editor.asmdef.meta | 3 --- .../Examples/UIComponentsExamples.asmdef.meta | 3 --- Assets/{Examples.meta => Samples.meta} | 0 .../{Examples => Samples}/Addressables.meta | 0 .../AddressablesExampleComponent.cs | 7 +++--- .../AddressablesExampleComponent.cs.meta | 0 .../Addressables/Data.meta | 0 .../Data/AddressablesExampleComponent.uss | 0 .../AddressablesExampleComponent.uss.meta | 0 .../Data/AddressablesExampleComponent.uxml | 0 .../AddressablesExampleComponent.uxml.meta | 0 .../Addressables/Editor.meta | 0 .../AddressablesExampleComponentWindow.cs | 2 +- ...AddressablesExampleComponentWindow.cs.meta | 0 ...onents.Samples.Addressables.Editor.asmdef} | 5 ++-- ...s.Samples.Addressables.Editor.asmdef.meta} | 0 .../UIComponents.Samples.Addressables.asmdef} | 5 ++-- ...mponents.Samples.Addressables.asmdef.meta} | 0 Assets/{Examples => Samples}/Counter.meta | 0 .../Counter/CounterComponent.cs | 5 ++-- .../Counter/CounterComponent.cs.meta | 0 .../Counter/CounterService.cs | 2 +- .../Counter/CounterService.cs.meta | 0 Assets/Samples/Counter/Editor.meta | 3 +++ .../Counter}/Editor/CounterComponentWindow.cs | 2 +- .../Editor/CounterComponentWindow.cs.meta | 0 ...IComponents.Samples.Counter.Editor.asmdef} | 7 +++--- ...ponents.Samples.Counter.Editor.asmdef.meta | 3 +++ .../Counter/ICounterService.cs | 2 +- .../Counter/ICounterService.cs.meta | 0 .../UIComponents.Samples.Counter.asmdef} | 4 +-- .../UIComponents.Samples.Counter.asmdef.meta | 3 +++ .../{Examples => Samples}/Counter/counter.gif | Bin .../Counter/counter.gif.meta | 0 .../Resources.meta} | 0 Assets/Samples/Resources/Editor.meta | 3 +++ .../Editor/ResourcesExampleComponentWindow.cs | 2 +- .../ResourcesExampleComponentWindow.cs.meta | 0 ...Components.Samples.Resources.Editor.asmdef | 19 +++++++++++++++ ...nents.Samples.Resources.Editor.asmdef.meta | 3 +++ .../Resources}/Resources.meta | 0 .../Resources}/Resources/Components.meta | 0 .../ResourcesExampleComponent.style.uss | 0 .../ResourcesExampleComponent.style.uss.meta | 0 .../Components/ResourcesExampleComponent.uxml | 0 .../ResourcesExampleComponent.uxml.meta | 0 .../Resources}/Resources/Margins.uss | 0 .../Resources}/Resources/Margins.uss.meta | 0 .../Resources}/ResourcesExampleComponent.cs | 4 +-- .../ResourcesExampleComponent.cs.meta | 0 .../UIComponents.Samples.Resources.asmdef | 16 ++++++++++++ ...UIComponents.Samples.Resources.asmdef.meta | 3 +++ Assets/UIComponents/package.json | 17 +++++++++++++ README.md | 2 +- 66 files changed, 99 insertions(+), 109 deletions(-) delete mode 100644 Assets/Examples/Editor.meta delete mode 100644 Assets/Examples/Editor/AssetDatabaseExampleComponentWindow.cs delete mode 100644 Assets/Examples/Editor/AssetDatabaseExampleComponentWindow.cs.meta delete mode 100644 Assets/Examples/Editor/LoadFromAssetDatabase.meta delete mode 100644 Assets/Examples/Editor/LoadFromAssetDatabase/AssetDatabaseExampleComponent.cs delete mode 100644 Assets/Examples/Editor/LoadFromAssetDatabase/AssetDatabaseExampleComponent.cs.meta delete mode 100644 Assets/Examples/Editor/LoadFromAssetDatabase/AssetDatabaseExampleComponent.uss delete mode 100644 Assets/Examples/Editor/LoadFromAssetDatabase/AssetDatabaseExampleComponent.uss.meta delete mode 100644 Assets/Examples/Editor/LoadFromAssetDatabase/AssetDatabaseExampleComponent.uxml delete mode 100644 Assets/Examples/Editor/LoadFromAssetDatabase/AssetDatabaseExampleComponent.uxml.meta delete mode 100644 Assets/Examples/Editor/UIComponentsExamples.Editor.asmdef.meta delete mode 100644 Assets/Examples/UIComponentsExamples.asmdef.meta rename Assets/{Examples.meta => Samples.meta} (100%) rename Assets/{Examples => Samples}/Addressables.meta (100%) rename Assets/{Examples => Samples}/Addressables/AddressablesExampleComponent.cs (62%) rename Assets/{Examples => Samples}/Addressables/AddressablesExampleComponent.cs.meta (100%) rename Assets/{Examples => Samples}/Addressables/Data.meta (100%) rename Assets/{Examples => Samples}/Addressables/Data/AddressablesExampleComponent.uss (100%) rename Assets/{Examples => Samples}/Addressables/Data/AddressablesExampleComponent.uss.meta (100%) rename Assets/{Examples => Samples}/Addressables/Data/AddressablesExampleComponent.uxml (100%) rename Assets/{Examples => Samples}/Addressables/Data/AddressablesExampleComponent.uxml.meta (100%) rename Assets/{Examples => Samples}/Addressables/Editor.meta (100%) rename Assets/{Examples => Samples}/Addressables/Editor/AddressablesExampleComponentWindow.cs (92%) rename Assets/{Examples => Samples}/Addressables/Editor/AddressablesExampleComponentWindow.cs.meta (100%) rename Assets/{Examples/Addressables/Editor/UIComponentsExamples.Addressables.Editor.asmdef => Samples/Addressables/Editor/UIComponents.Samples.Addressables.Editor.asmdef} (82%) rename Assets/{Examples/Addressables/Editor/UIComponentsExamples.Addressables.Editor.asmdef.meta => Samples/Addressables/Editor/UIComponents.Samples.Addressables.Editor.asmdef.meta} (100%) rename Assets/{Examples/Addressables/UIComponentsExamples.Addressables.asmdef => Samples/Addressables/UIComponents.Samples.Addressables.asmdef} (83%) rename Assets/{Examples/Addressables/UIComponentsExamples.Addressables.asmdef.meta => Samples/Addressables/UIComponents.Samples.Addressables.asmdef.meta} (100%) rename Assets/{Examples => Samples}/Counter.meta (100%) rename Assets/{Examples => Samples}/Counter/CounterComponent.cs (90%) rename Assets/{Examples => Samples}/Counter/CounterComponent.cs.meta (100%) rename Assets/{Examples => Samples}/Counter/CounterService.cs (81%) rename Assets/{Examples => Samples}/Counter/CounterService.cs.meta (100%) create mode 100644 Assets/Samples/Counter/Editor.meta rename Assets/{Examples => Samples/Counter}/Editor/CounterComponentWindow.cs (92%) rename Assets/{Examples => Samples/Counter}/Editor/CounterComponentWindow.cs.meta (100%) rename Assets/{Examples/Editor/UIComponentsExamples.Editor.asmdef => Samples/Counter/Editor/UIComponents.Samples.Counter.Editor.asmdef} (65%) create mode 100644 Assets/Samples/Counter/Editor/UIComponents.Samples.Counter.Editor.asmdef.meta rename Assets/{Examples => Samples}/Counter/ICounterService.cs (72%) rename Assets/{Examples => Samples}/Counter/ICounterService.cs.meta (100%) rename Assets/{Examples/UIComponentsExamples.asmdef => Samples/Counter/UIComponents.Samples.Counter.asmdef} (79%) create mode 100644 Assets/Samples/Counter/UIComponents.Samples.Counter.asmdef.meta rename Assets/{Examples => Samples}/Counter/counter.gif (100%) rename Assets/{Examples => Samples}/Counter/counter.gif.meta (100%) rename Assets/{Examples/LoadFromResources.meta => Samples/Resources.meta} (100%) create mode 100644 Assets/Samples/Resources/Editor.meta rename Assets/{Examples => Samples/Resources}/Editor/ResourcesExampleComponentWindow.cs (93%) rename Assets/{Examples => Samples/Resources}/Editor/ResourcesExampleComponentWindow.cs.meta (100%) create mode 100644 Assets/Samples/Resources/Editor/UIComponents.Samples.Resources.Editor.asmdef create mode 100644 Assets/Samples/Resources/Editor/UIComponents.Samples.Resources.Editor.asmdef.meta rename Assets/{Examples/LoadFromResources => Samples/Resources}/Resources.meta (100%) rename Assets/{Examples/LoadFromResources => Samples/Resources}/Resources/Components.meta (100%) rename Assets/{Examples/LoadFromResources => Samples/Resources}/Resources/Components/ResourcesExampleComponent.style.uss (100%) rename Assets/{Examples/LoadFromResources => Samples/Resources}/Resources/Components/ResourcesExampleComponent.style.uss.meta (100%) rename Assets/{Examples/LoadFromResources => Samples/Resources}/Resources/Components/ResourcesExampleComponent.uxml (100%) rename Assets/{Examples/LoadFromResources => Samples/Resources}/Resources/Components/ResourcesExampleComponent.uxml.meta (100%) rename Assets/{Examples/LoadFromResources => Samples/Resources}/Resources/Margins.uss (100%) rename Assets/{Examples/LoadFromResources => Samples/Resources}/Resources/Margins.uss.meta (100%) rename Assets/{Examples/LoadFromResources => Samples/Resources}/ResourcesExampleComponent.cs (84%) rename Assets/{Examples/LoadFromResources => Samples/Resources}/ResourcesExampleComponent.cs.meta (100%) create mode 100644 Assets/Samples/Resources/UIComponents.Samples.Resources.asmdef create mode 100644 Assets/Samples/Resources/UIComponents.Samples.Resources.asmdef.meta diff --git a/.github/workflows/upm.yml b/.github/workflows/upm.yml index b15b9e3b..0e6ede99 100644 --- a/.github/workflows/upm.yml +++ b/.github/workflows/upm.yml @@ -27,6 +27,10 @@ jobs: git config --global user.email 'github-bot@users.noreply.github.com' - name: Copy meta files to package folder run: cp CHANGELOG.md CHANGELOG.md.meta LICENSE.md LICENSE.md.meta README.md README.md.meta "$UICOMPONENTS_PATH" + - name: Copy samples to package folder + run: | + cp -r Assets/Samples/ "$UICOMPONENTS_PATH"/Samples~ + rm "$UICOMPONENTS_PATH"/Samples~/*.meta - name: Create commit for the meta files run: | git add -A diff --git a/Assets/AddressableAssetsData/AssetGroups/Default Local Group.asset b/Assets/AddressableAssetsData/AssetGroups/Default Local Group.asset index 77477d6c..1f67a5de 100644 --- a/Assets/AddressableAssetsData/AssetGroups/Default Local Group.asset +++ b/Assets/AddressableAssetsData/AssetGroups/Default Local Group.asset @@ -25,12 +25,12 @@ MonoBehaviour: m_Address: Assets/UIComponents.Tests/Addressables/Assets/Component.uxml m_ReadOnly: 0 m_SerializedLabels: [] - - m_GUID: 3f5abc4da50c49b8b1d34cf4fa50850a - m_Address: Assets/Examples/Addressables/Data/AddressablesExampleComponent.uss + - m_GUID: e9bbd2fb164840019750b795061e4bf2 + m_Address: Assets/Samples/Addressables/Data/AddressablesExampleComponent.uxml m_ReadOnly: 0 m_SerializedLabels: [] - - m_GUID: e9bbd2fb164840019750b795061e4bf2 - m_Address: Assets/Examples/Addressables/Data/AddressablesExampleComponent.uxml + - m_GUID: 3f5abc4da50c49b8b1d34cf4fa50850a + m_Address: Assets/Samples/Addressables/Data/AddressablesExampleComponent.uss m_ReadOnly: 0 m_SerializedLabels: [] m_ReadOnly: 0 diff --git a/Assets/Examples/Editor.meta b/Assets/Examples/Editor.meta deleted file mode 100644 index 2ff0ddc9..00000000 --- a/Assets/Examples/Editor.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 45e2d9683f454bc09a0904a0a813ac36 -timeCreated: 1651588942 \ No newline at end of file diff --git a/Assets/Examples/Editor/AssetDatabaseExampleComponentWindow.cs b/Assets/Examples/Editor/AssetDatabaseExampleComponentWindow.cs deleted file mode 100644 index 71341241..00000000 --- a/Assets/Examples/Editor/AssetDatabaseExampleComponentWindow.cs +++ /dev/null @@ -1,23 +0,0 @@ -using UnityEditor; -using UnityEngine; - -namespace UIComponentsExamples.Editor -{ - public class AssetDatabaseExampleComponentWindow : EditorWindow - { - [MenuItem("UIComponents Examples/Loading Assets/AssetDatabase")] - private static void ShowWindow() - { - var window = GetWindow(); - window.titleContent = new GUIContent("Loading from AssetDatabase"); - window.Show(); - } - - private void CreateGUI() - { - rootVisualElement.style.minWidth = 150; - rootVisualElement.style.minHeight = 40; - rootVisualElement.Add(new AssetDatabaseExampleComponent()); - } - } -} \ No newline at end of file diff --git a/Assets/Examples/Editor/AssetDatabaseExampleComponentWindow.cs.meta b/Assets/Examples/Editor/AssetDatabaseExampleComponentWindow.cs.meta deleted file mode 100644 index 93e5b78b..00000000 --- a/Assets/Examples/Editor/AssetDatabaseExampleComponentWindow.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 8643573719e340aa857352de274b7dfc -timeCreated: 1651588428 \ No newline at end of file diff --git a/Assets/Examples/Editor/LoadFromAssetDatabase.meta b/Assets/Examples/Editor/LoadFromAssetDatabase.meta deleted file mode 100644 index a232e12f..00000000 --- a/Assets/Examples/Editor/LoadFromAssetDatabase.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: e37edaf341151e14bbb2510839d02aff -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Examples/Editor/LoadFromAssetDatabase/AssetDatabaseExampleComponent.cs b/Assets/Examples/Editor/LoadFromAssetDatabase/AssetDatabaseExampleComponent.cs deleted file mode 100644 index 06f43889..00000000 --- a/Assets/Examples/Editor/LoadFromAssetDatabase/AssetDatabaseExampleComponent.cs +++ /dev/null @@ -1,11 +0,0 @@ -using UIComponents; -using UIComponents.Editor; - -namespace UIComponentsExamples.Editor -{ - [AssetPath("Assets/Examples/Editor/LoadFromAssetDatabase")] - [Layout("AssetDatabaseExampleComponent.uxml")] - [Stylesheet("AssetDatabaseExampleComponent.uss")] - [Dependency(typeof(IAssetResolver), provide: typeof(AssetDatabaseAssetResolver))] - public class AssetDatabaseExampleComponent : UIComponent {} -} \ No newline at end of file diff --git a/Assets/Examples/Editor/LoadFromAssetDatabase/AssetDatabaseExampleComponent.cs.meta b/Assets/Examples/Editor/LoadFromAssetDatabase/AssetDatabaseExampleComponent.cs.meta deleted file mode 100644 index 3f5748f2..00000000 --- a/Assets/Examples/Editor/LoadFromAssetDatabase/AssetDatabaseExampleComponent.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 8a8855e45bb0442b9ed01288e0dd8725 -timeCreated: 1651588094 \ No newline at end of file diff --git a/Assets/Examples/Editor/LoadFromAssetDatabase/AssetDatabaseExampleComponent.uss b/Assets/Examples/Editor/LoadFromAssetDatabase/AssetDatabaseExampleComponent.uss deleted file mode 100644 index f2843cf2..00000000 --- a/Assets/Examples/Editor/LoadFromAssetDatabase/AssetDatabaseExampleComponent.uss +++ /dev/null @@ -1,8 +0,0 @@ -#assetdatabase-example-header { - font-size: 20px; - -unity-font-style: bold-and-italic; -} - -Label { - white-space: normal; -} \ No newline at end of file diff --git a/Assets/Examples/Editor/LoadFromAssetDatabase/AssetDatabaseExampleComponent.uss.meta b/Assets/Examples/Editor/LoadFromAssetDatabase/AssetDatabaseExampleComponent.uss.meta deleted file mode 100644 index d93645bb..00000000 --- a/Assets/Examples/Editor/LoadFromAssetDatabase/AssetDatabaseExampleComponent.uss.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 192615e1e0a94ab9a9a5e9ec7cc562f1 -timeCreated: 1651588264 \ No newline at end of file diff --git a/Assets/Examples/Editor/LoadFromAssetDatabase/AssetDatabaseExampleComponent.uxml b/Assets/Examples/Editor/LoadFromAssetDatabase/AssetDatabaseExampleComponent.uxml deleted file mode 100644 index 3c8346fe..00000000 --- a/Assets/Examples/Editor/LoadFromAssetDatabase/AssetDatabaseExampleComponent.uxml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/Assets/Examples/Editor/LoadFromAssetDatabase/AssetDatabaseExampleComponent.uxml.meta b/Assets/Examples/Editor/LoadFromAssetDatabase/AssetDatabaseExampleComponent.uxml.meta deleted file mode 100644 index a1946747..00000000 --- a/Assets/Examples/Editor/LoadFromAssetDatabase/AssetDatabaseExampleComponent.uxml.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 2f3208ba3a7d4e3fa9814e8ad7814113 -timeCreated: 1651588243 \ No newline at end of file diff --git a/Assets/Examples/Editor/UIComponentsExamples.Editor.asmdef.meta b/Assets/Examples/Editor/UIComponentsExamples.Editor.asmdef.meta deleted file mode 100644 index e4bebbc8..00000000 --- a/Assets/Examples/Editor/UIComponentsExamples.Editor.asmdef.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 595f64643d154e46b17a4c776b68636f -timeCreated: 1651588974 \ No newline at end of file diff --git a/Assets/Examples/UIComponentsExamples.asmdef.meta b/Assets/Examples/UIComponentsExamples.asmdef.meta deleted file mode 100644 index 6645e7b6..00000000 --- a/Assets/Examples/UIComponentsExamples.asmdef.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 12a73a47a9014699b2fba61bc5f9a0dc -timeCreated: 1651588963 \ No newline at end of file diff --git a/Assets/Examples.meta b/Assets/Samples.meta similarity index 100% rename from Assets/Examples.meta rename to Assets/Samples.meta diff --git a/Assets/Examples/Addressables.meta b/Assets/Samples/Addressables.meta similarity index 100% rename from Assets/Examples/Addressables.meta rename to Assets/Samples/Addressables.meta diff --git a/Assets/Examples/Addressables/AddressablesExampleComponent.cs b/Assets/Samples/Addressables/AddressablesExampleComponent.cs similarity index 62% rename from Assets/Examples/Addressables/AddressablesExampleComponent.cs rename to Assets/Samples/Addressables/AddressablesExampleComponent.cs index cf3fb153..9c0ffe66 100644 --- a/Assets/Examples/Addressables/AddressablesExampleComponent.cs +++ b/Assets/Samples/Addressables/AddressablesExampleComponent.cs @@ -1,9 +1,8 @@ -using UIComponents; -using UIComponents.Addressables; +using UIComponents.Addressables; -namespace UIComponentsExamples.Addressables +namespace UIComponents.Samples.Addressables { - [AssetPath("Assets/Examples/Addressables/Data")] + [AssetPath("Assets/Samples/Addressables/Data")] [Layout("AddressablesExampleComponent.uxml")] [Stylesheet("AddressablesExampleComponent.uss")] [Dependency(typeof(IAssetResolver), provide: typeof(AddressableAssetResolver))] diff --git a/Assets/Examples/Addressables/AddressablesExampleComponent.cs.meta b/Assets/Samples/Addressables/AddressablesExampleComponent.cs.meta similarity index 100% rename from Assets/Examples/Addressables/AddressablesExampleComponent.cs.meta rename to Assets/Samples/Addressables/AddressablesExampleComponent.cs.meta diff --git a/Assets/Examples/Addressables/Data.meta b/Assets/Samples/Addressables/Data.meta similarity index 100% rename from Assets/Examples/Addressables/Data.meta rename to Assets/Samples/Addressables/Data.meta diff --git a/Assets/Examples/Addressables/Data/AddressablesExampleComponent.uss b/Assets/Samples/Addressables/Data/AddressablesExampleComponent.uss similarity index 100% rename from Assets/Examples/Addressables/Data/AddressablesExampleComponent.uss rename to Assets/Samples/Addressables/Data/AddressablesExampleComponent.uss diff --git a/Assets/Examples/Addressables/Data/AddressablesExampleComponent.uss.meta b/Assets/Samples/Addressables/Data/AddressablesExampleComponent.uss.meta similarity index 100% rename from Assets/Examples/Addressables/Data/AddressablesExampleComponent.uss.meta rename to Assets/Samples/Addressables/Data/AddressablesExampleComponent.uss.meta diff --git a/Assets/Examples/Addressables/Data/AddressablesExampleComponent.uxml b/Assets/Samples/Addressables/Data/AddressablesExampleComponent.uxml similarity index 100% rename from Assets/Examples/Addressables/Data/AddressablesExampleComponent.uxml rename to Assets/Samples/Addressables/Data/AddressablesExampleComponent.uxml diff --git a/Assets/Examples/Addressables/Data/AddressablesExampleComponent.uxml.meta b/Assets/Samples/Addressables/Data/AddressablesExampleComponent.uxml.meta similarity index 100% rename from Assets/Examples/Addressables/Data/AddressablesExampleComponent.uxml.meta rename to Assets/Samples/Addressables/Data/AddressablesExampleComponent.uxml.meta diff --git a/Assets/Examples/Addressables/Editor.meta b/Assets/Samples/Addressables/Editor.meta similarity index 100% rename from Assets/Examples/Addressables/Editor.meta rename to Assets/Samples/Addressables/Editor.meta diff --git a/Assets/Examples/Addressables/Editor/AddressablesExampleComponentWindow.cs b/Assets/Samples/Addressables/Editor/AddressablesExampleComponentWindow.cs similarity index 92% rename from Assets/Examples/Addressables/Editor/AddressablesExampleComponentWindow.cs rename to Assets/Samples/Addressables/Editor/AddressablesExampleComponentWindow.cs index 54a62574..cf3194ed 100644 --- a/Assets/Examples/Addressables/Editor/AddressablesExampleComponentWindow.cs +++ b/Assets/Samples/Addressables/Editor/AddressablesExampleComponentWindow.cs @@ -1,7 +1,7 @@ using UnityEditor; using UnityEngine; -namespace UIComponentsExamples.Addressables.Editor +namespace UIComponents.Samples.Addressables.Editor { public class AddressablesExampleComponentWindow : EditorWindow { diff --git a/Assets/Examples/Addressables/Editor/AddressablesExampleComponentWindow.cs.meta b/Assets/Samples/Addressables/Editor/AddressablesExampleComponentWindow.cs.meta similarity index 100% rename from Assets/Examples/Addressables/Editor/AddressablesExampleComponentWindow.cs.meta rename to Assets/Samples/Addressables/Editor/AddressablesExampleComponentWindow.cs.meta diff --git a/Assets/Examples/Addressables/Editor/UIComponentsExamples.Addressables.Editor.asmdef b/Assets/Samples/Addressables/Editor/UIComponents.Samples.Addressables.Editor.asmdef similarity index 82% rename from Assets/Examples/Addressables/Editor/UIComponentsExamples.Addressables.Editor.asmdef rename to Assets/Samples/Addressables/Editor/UIComponents.Samples.Addressables.Editor.asmdef index 6373728d..d7505db1 100644 --- a/Assets/Examples/Addressables/Editor/UIComponentsExamples.Addressables.Editor.asmdef +++ b/Assets/Samples/Addressables/Editor/UIComponents.Samples.Addressables.Editor.asmdef @@ -1,9 +1,8 @@ { - "name": "UIComponentsExamples.Addressables.Editor", - "rootNamespace": "UIComponentsExamples", + "name": "UIComponents.Samples.Addressables.Editor", + "rootNamespace": "UIComponents.Samples", "references": [ "GUID:d593635333b4cae48bac5b5f0b596e90", - "GUID:12a73a47a9014699b2fba61bc5f9a0dc", "GUID:3784f1f14a0a4923ae912fdf829426a8", "GUID:9e24947de15b9834991c9d8411ea37cf", "GUID:84651a3751eca9349aac36a66bba901b" diff --git a/Assets/Examples/Addressables/Editor/UIComponentsExamples.Addressables.Editor.asmdef.meta b/Assets/Samples/Addressables/Editor/UIComponents.Samples.Addressables.Editor.asmdef.meta similarity index 100% rename from Assets/Examples/Addressables/Editor/UIComponentsExamples.Addressables.Editor.asmdef.meta rename to Assets/Samples/Addressables/Editor/UIComponents.Samples.Addressables.Editor.asmdef.meta diff --git a/Assets/Examples/Addressables/UIComponentsExamples.Addressables.asmdef b/Assets/Samples/Addressables/UIComponents.Samples.Addressables.asmdef similarity index 83% rename from Assets/Examples/Addressables/UIComponentsExamples.Addressables.asmdef rename to Assets/Samples/Addressables/UIComponents.Samples.Addressables.asmdef index 233d9927..45538c0a 100644 --- a/Assets/Examples/Addressables/UIComponentsExamples.Addressables.asmdef +++ b/Assets/Samples/Addressables/UIComponents.Samples.Addressables.asmdef @@ -1,9 +1,8 @@ { - "name": "UIComponentsExamples.Addressables", - "rootNamespace": "UIComponentsExamples", + "name": "UIComponents.Samples.Addressables", + "rootNamespace": "UIComponents.Samples", "references": [ "GUID:d593635333b4cae48bac5b5f0b596e90", - "GUID:12a73a47a9014699b2fba61bc5f9a0dc", "GUID:9e24947de15b9834991c9d8411ea37cf", "GUID:34063fb90481ae5469861eb4a68e5445", "GUID:84651a3751eca9349aac36a66bba901b" diff --git a/Assets/Examples/Addressables/UIComponentsExamples.Addressables.asmdef.meta b/Assets/Samples/Addressables/UIComponents.Samples.Addressables.asmdef.meta similarity index 100% rename from Assets/Examples/Addressables/UIComponentsExamples.Addressables.asmdef.meta rename to Assets/Samples/Addressables/UIComponents.Samples.Addressables.asmdef.meta diff --git a/Assets/Examples/Counter.meta b/Assets/Samples/Counter.meta similarity index 100% rename from Assets/Examples/Counter.meta rename to Assets/Samples/Counter.meta diff --git a/Assets/Examples/Counter/CounterComponent.cs b/Assets/Samples/Counter/CounterComponent.cs similarity index 90% rename from Assets/Examples/Counter/CounterComponent.cs rename to Assets/Samples/Counter/CounterComponent.cs index 97f6217f..b02255ab 100644 --- a/Assets/Examples/Counter/CounterComponent.cs +++ b/Assets/Samples/Counter/CounterComponent.cs @@ -1,7 +1,6 @@ -using UIComponents; -using UnityEngine.UIElements; +using UnityEngine.UIElements; -namespace UIComponentsExamples +namespace UIComponents.Samples.Counter { [Dependency(typeof(ICounterService), provide: typeof(CounterService))] public class CounterComponent : UIComponent diff --git a/Assets/Examples/Counter/CounterComponent.cs.meta b/Assets/Samples/Counter/CounterComponent.cs.meta similarity index 100% rename from Assets/Examples/Counter/CounterComponent.cs.meta rename to Assets/Samples/Counter/CounterComponent.cs.meta diff --git a/Assets/Examples/Counter/CounterService.cs b/Assets/Samples/Counter/CounterService.cs similarity index 81% rename from Assets/Examples/Counter/CounterService.cs rename to Assets/Samples/Counter/CounterService.cs index e2f6eb57..762b7c2e 100644 --- a/Assets/Examples/Counter/CounterService.cs +++ b/Assets/Samples/Counter/CounterService.cs @@ -1,4 +1,4 @@ -namespace UIComponentsExamples +namespace UIComponents.Samples.Counter { public class CounterService : ICounterService { diff --git a/Assets/Examples/Counter/CounterService.cs.meta b/Assets/Samples/Counter/CounterService.cs.meta similarity index 100% rename from Assets/Examples/Counter/CounterService.cs.meta rename to Assets/Samples/Counter/CounterService.cs.meta diff --git a/Assets/Samples/Counter/Editor.meta b/Assets/Samples/Counter/Editor.meta new file mode 100644 index 00000000..e497da0e --- /dev/null +++ b/Assets/Samples/Counter/Editor.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: ea998f33f6804c67a1a6f1218f538904 +timeCreated: 1652334041 \ No newline at end of file diff --git a/Assets/Examples/Editor/CounterComponentWindow.cs b/Assets/Samples/Counter/Editor/CounterComponentWindow.cs similarity index 92% rename from Assets/Examples/Editor/CounterComponentWindow.cs rename to Assets/Samples/Counter/Editor/CounterComponentWindow.cs index 42f9452d..38f15a3d 100644 --- a/Assets/Examples/Editor/CounterComponentWindow.cs +++ b/Assets/Samples/Counter/Editor/CounterComponentWindow.cs @@ -1,7 +1,7 @@ using UnityEditor; using UnityEngine; -namespace UIComponentsExamples.Editor +namespace UIComponents.Samples.Counter.Editor { public class CounterComponentWindow : EditorWindow { diff --git a/Assets/Examples/Editor/CounterComponentWindow.cs.meta b/Assets/Samples/Counter/Editor/CounterComponentWindow.cs.meta similarity index 100% rename from Assets/Examples/Editor/CounterComponentWindow.cs.meta rename to Assets/Samples/Counter/Editor/CounterComponentWindow.cs.meta diff --git a/Assets/Examples/Editor/UIComponentsExamples.Editor.asmdef b/Assets/Samples/Counter/Editor/UIComponents.Samples.Counter.Editor.asmdef similarity index 65% rename from Assets/Examples/Editor/UIComponentsExamples.Editor.asmdef rename to Assets/Samples/Counter/Editor/UIComponents.Samples.Counter.Editor.asmdef index a9245909..be6a2d8f 100644 --- a/Assets/Examples/Editor/UIComponentsExamples.Editor.asmdef +++ b/Assets/Samples/Counter/Editor/UIComponents.Samples.Counter.Editor.asmdef @@ -1,10 +1,9 @@ { - "name": "UIComponentsExamples.Editor", - "rootNamespace": "UIComponentsExamples.Editor", + "name": "UIComponents.Samples.Counter.Editor", + "rootNamespace": "UIComponents.Samples", "references": [ "GUID:d593635333b4cae48bac5b5f0b596e90", - "GUID:7282a494dd2226f45a32fcf2256d7c89", - "GUID:12a73a47a9014699b2fba61bc5f9a0dc" + "GUID:85e613970e1a4b2da36dc72b51d4b4d0" ], "includePlatforms": [ "Editor" diff --git a/Assets/Samples/Counter/Editor/UIComponents.Samples.Counter.Editor.asmdef.meta b/Assets/Samples/Counter/Editor/UIComponents.Samples.Counter.Editor.asmdef.meta new file mode 100644 index 00000000..39fc30b4 --- /dev/null +++ b/Assets/Samples/Counter/Editor/UIComponents.Samples.Counter.Editor.asmdef.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 8e2b908c0aba4fdeaa383aa20021e079 +timeCreated: 1652334047 \ No newline at end of file diff --git a/Assets/Examples/Counter/ICounterService.cs b/Assets/Samples/Counter/ICounterService.cs similarity index 72% rename from Assets/Examples/Counter/ICounterService.cs rename to Assets/Samples/Counter/ICounterService.cs index b122a125..752696fb 100644 --- a/Assets/Examples/Counter/ICounterService.cs +++ b/Assets/Samples/Counter/ICounterService.cs @@ -1,4 +1,4 @@ -namespace UIComponentsExamples +namespace UIComponents.Samples.Counter { public interface ICounterService { diff --git a/Assets/Examples/Counter/ICounterService.cs.meta b/Assets/Samples/Counter/ICounterService.cs.meta similarity index 100% rename from Assets/Examples/Counter/ICounterService.cs.meta rename to Assets/Samples/Counter/ICounterService.cs.meta diff --git a/Assets/Examples/UIComponentsExamples.asmdef b/Assets/Samples/Counter/UIComponents.Samples.Counter.asmdef similarity index 79% rename from Assets/Examples/UIComponentsExamples.asmdef rename to Assets/Samples/Counter/UIComponents.Samples.Counter.asmdef index 62517de6..5f2c0550 100644 --- a/Assets/Examples/UIComponentsExamples.asmdef +++ b/Assets/Samples/Counter/UIComponents.Samples.Counter.asmdef @@ -1,6 +1,6 @@ { - "name": "UIComponentsExamples", - "rootNamespace": "UIComponentsExamples", + "name": "UIComponents.Samples.Counter", + "rootNamespace": "UIComponents.Samples", "references": [ "GUID:d593635333b4cae48bac5b5f0b596e90" ], diff --git a/Assets/Samples/Counter/UIComponents.Samples.Counter.asmdef.meta b/Assets/Samples/Counter/UIComponents.Samples.Counter.asmdef.meta new file mode 100644 index 00000000..dea49432 --- /dev/null +++ b/Assets/Samples/Counter/UIComponents.Samples.Counter.asmdef.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 85e613970e1a4b2da36dc72b51d4b4d0 +timeCreated: 1652334033 \ No newline at end of file diff --git a/Assets/Examples/Counter/counter.gif b/Assets/Samples/Counter/counter.gif similarity index 100% rename from Assets/Examples/Counter/counter.gif rename to Assets/Samples/Counter/counter.gif diff --git a/Assets/Examples/Counter/counter.gif.meta b/Assets/Samples/Counter/counter.gif.meta similarity index 100% rename from Assets/Examples/Counter/counter.gif.meta rename to Assets/Samples/Counter/counter.gif.meta diff --git a/Assets/Examples/LoadFromResources.meta b/Assets/Samples/Resources.meta similarity index 100% rename from Assets/Examples/LoadFromResources.meta rename to Assets/Samples/Resources.meta diff --git a/Assets/Samples/Resources/Editor.meta b/Assets/Samples/Resources/Editor.meta new file mode 100644 index 00000000..9163a35e --- /dev/null +++ b/Assets/Samples/Resources/Editor.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 8d1a2fd351cf4ebb896cad8d833e90c4 +timeCreated: 1652334189 \ No newline at end of file diff --git a/Assets/Examples/Editor/ResourcesExampleComponentWindow.cs b/Assets/Samples/Resources/Editor/ResourcesExampleComponentWindow.cs similarity index 93% rename from Assets/Examples/Editor/ResourcesExampleComponentWindow.cs rename to Assets/Samples/Resources/Editor/ResourcesExampleComponentWindow.cs index e9d8587b..dc86dea4 100644 --- a/Assets/Examples/Editor/ResourcesExampleComponentWindow.cs +++ b/Assets/Samples/Resources/Editor/ResourcesExampleComponentWindow.cs @@ -1,7 +1,7 @@ using UnityEditor; using UnityEngine; -namespace UIComponentsExamples.Editor +namespace UIComponents.Samples.Resources.Editor { public class ResourcesExampleComponentWindow : EditorWindow { diff --git a/Assets/Examples/Editor/ResourcesExampleComponentWindow.cs.meta b/Assets/Samples/Resources/Editor/ResourcesExampleComponentWindow.cs.meta similarity index 100% rename from Assets/Examples/Editor/ResourcesExampleComponentWindow.cs.meta rename to Assets/Samples/Resources/Editor/ResourcesExampleComponentWindow.cs.meta diff --git a/Assets/Samples/Resources/Editor/UIComponents.Samples.Resources.Editor.asmdef b/Assets/Samples/Resources/Editor/UIComponents.Samples.Resources.Editor.asmdef new file mode 100644 index 00000000..374a7674 --- /dev/null +++ b/Assets/Samples/Resources/Editor/UIComponents.Samples.Resources.Editor.asmdef @@ -0,0 +1,19 @@ +{ + "name": "UIComponents.Samples.Resources.Editor", + "rootNamespace": "UIComponents.Samples", + "references": [ + "GUID:d593635333b4cae48bac5b5f0b596e90", + "GUID:af36ccbbcbfb40b09be04c65626bd552" + ], + "includePlatforms": [ + "Editor" + ], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [], + "versionDefines": [], + "noEngineReferences": false +} \ No newline at end of file diff --git a/Assets/Samples/Resources/Editor/UIComponents.Samples.Resources.Editor.asmdef.meta b/Assets/Samples/Resources/Editor/UIComponents.Samples.Resources.Editor.asmdef.meta new file mode 100644 index 00000000..9da22fcc --- /dev/null +++ b/Assets/Samples/Resources/Editor/UIComponents.Samples.Resources.Editor.asmdef.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: ce4d8580104a46f981b8d4e43b833b89 +timeCreated: 1652334244 \ No newline at end of file diff --git a/Assets/Examples/LoadFromResources/Resources.meta b/Assets/Samples/Resources/Resources.meta similarity index 100% rename from Assets/Examples/LoadFromResources/Resources.meta rename to Assets/Samples/Resources/Resources.meta diff --git a/Assets/Examples/LoadFromResources/Resources/Components.meta b/Assets/Samples/Resources/Resources/Components.meta similarity index 100% rename from Assets/Examples/LoadFromResources/Resources/Components.meta rename to Assets/Samples/Resources/Resources/Components.meta diff --git a/Assets/Examples/LoadFromResources/Resources/Components/ResourcesExampleComponent.style.uss b/Assets/Samples/Resources/Resources/Components/ResourcesExampleComponent.style.uss similarity index 100% rename from Assets/Examples/LoadFromResources/Resources/Components/ResourcesExampleComponent.style.uss rename to Assets/Samples/Resources/Resources/Components/ResourcesExampleComponent.style.uss diff --git a/Assets/Examples/LoadFromResources/Resources/Components/ResourcesExampleComponent.style.uss.meta b/Assets/Samples/Resources/Resources/Components/ResourcesExampleComponent.style.uss.meta similarity index 100% rename from Assets/Examples/LoadFromResources/Resources/Components/ResourcesExampleComponent.style.uss.meta rename to Assets/Samples/Resources/Resources/Components/ResourcesExampleComponent.style.uss.meta diff --git a/Assets/Examples/LoadFromResources/Resources/Components/ResourcesExampleComponent.uxml b/Assets/Samples/Resources/Resources/Components/ResourcesExampleComponent.uxml similarity index 100% rename from Assets/Examples/LoadFromResources/Resources/Components/ResourcesExampleComponent.uxml rename to Assets/Samples/Resources/Resources/Components/ResourcesExampleComponent.uxml diff --git a/Assets/Examples/LoadFromResources/Resources/Components/ResourcesExampleComponent.uxml.meta b/Assets/Samples/Resources/Resources/Components/ResourcesExampleComponent.uxml.meta similarity index 100% rename from Assets/Examples/LoadFromResources/Resources/Components/ResourcesExampleComponent.uxml.meta rename to Assets/Samples/Resources/Resources/Components/ResourcesExampleComponent.uxml.meta diff --git a/Assets/Examples/LoadFromResources/Resources/Margins.uss b/Assets/Samples/Resources/Resources/Margins.uss similarity index 100% rename from Assets/Examples/LoadFromResources/Resources/Margins.uss rename to Assets/Samples/Resources/Resources/Margins.uss diff --git a/Assets/Examples/LoadFromResources/Resources/Margins.uss.meta b/Assets/Samples/Resources/Resources/Margins.uss.meta similarity index 100% rename from Assets/Examples/LoadFromResources/Resources/Margins.uss.meta rename to Assets/Samples/Resources/Resources/Margins.uss.meta diff --git a/Assets/Examples/LoadFromResources/ResourcesExampleComponent.cs b/Assets/Samples/Resources/ResourcesExampleComponent.cs similarity index 84% rename from Assets/Examples/LoadFromResources/ResourcesExampleComponent.cs rename to Assets/Samples/Resources/ResourcesExampleComponent.cs index 98cf1195..ea0c2962 100644 --- a/Assets/Examples/LoadFromResources/ResourcesExampleComponent.cs +++ b/Assets/Samples/Resources/ResourcesExampleComponent.cs @@ -1,6 +1,4 @@ -using UIComponents; - -namespace UIComponentsExamples +namespace UIComponents.Samples.Resources { /// /// Assets are loaded from Resources by default. diff --git a/Assets/Examples/LoadFromResources/ResourcesExampleComponent.cs.meta b/Assets/Samples/Resources/ResourcesExampleComponent.cs.meta similarity index 100% rename from Assets/Examples/LoadFromResources/ResourcesExampleComponent.cs.meta rename to Assets/Samples/Resources/ResourcesExampleComponent.cs.meta diff --git a/Assets/Samples/Resources/UIComponents.Samples.Resources.asmdef b/Assets/Samples/Resources/UIComponents.Samples.Resources.asmdef new file mode 100644 index 00000000..7f42dde6 --- /dev/null +++ b/Assets/Samples/Resources/UIComponents.Samples.Resources.asmdef @@ -0,0 +1,16 @@ +{ + "name": "UIComponents.Samples.Resources", + "rootNamespace": "UIComponents.Samples", + "references": [ + "GUID:d593635333b4cae48bac5b5f0b596e90" + ], + "includePlatforms": [], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [], + "versionDefines": [], + "noEngineReferences": false +} \ No newline at end of file diff --git a/Assets/Samples/Resources/UIComponents.Samples.Resources.asmdef.meta b/Assets/Samples/Resources/UIComponents.Samples.Resources.asmdef.meta new file mode 100644 index 00000000..1272fd86 --- /dev/null +++ b/Assets/Samples/Resources/UIComponents.Samples.Resources.asmdef.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: af36ccbbcbfb40b09be04c65626bd552 +timeCreated: 1652334239 \ No newline at end of file diff --git a/Assets/UIComponents/package.json b/Assets/UIComponents/package.json index 63136e7b..d9bf0f11 100644 --- a/Assets/UIComponents/package.json +++ b/Assets/UIComponents/package.json @@ -15,6 +15,23 @@ "uielements", "library" ], + "samples": [ + { + "displayName": "CounterComponent (Dependency injection)", + "description": "Contains an example of simple dependency injection.", + "path": "Samples~/Counter" + }, + { + "displayName": "Asset Loading from Resources", + "description": "Contains an example of asset loading from Resources.", + "path": "Samples~/Resources" + }, + { + "displayName": "Asset Loading from Addressables", + "description": "Contains an example of asset loading from Addressables.", + "path": "Samples~/Addressables" + } + ], "license": "MIT", "changelogUrl": "https://github.com/jonisavo/uicomponents/blob/main/CHANGELOG.md", "documentationUrl": "https://github.com/jonisavo/uicomponents/blob/main/README.md", diff --git a/README.md b/README.md index 4ccec047..37978ae9 100644 --- a/README.md +++ b/README.md @@ -169,7 +169,7 @@ This creates a component which can be used to increment a number. **Each instance of CounterComponent receives the same instance of CounterService.** -![CounterComponent in action](https://github.com/jonisavo/uicomponents/blob/main/Assets/Examples/Counter/counter.gif?raw=true) +![CounterComponent in action](https://github.com/jonisavo/uicomponents/blob/main/Assets/Samples/Counter/counter.gif?raw=true) ### Get dependency safely