From 7def5364163f45d9bcb568e14070cc50e3759203 Mon Sep 17 00:00:00 2001 From: Elias Hodel Date: Thu, 5 Oct 2023 11:51:30 +0200 Subject: [PATCH 1/8] Add Constructor with value --- Runtime/SerializableInterface.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Runtime/SerializableInterface.cs b/Runtime/SerializableInterface.cs index a5a9224..2c9dd1c 100644 --- a/Runtime/SerializableInterface.cs +++ b/Runtime/SerializableInterface.cs @@ -15,6 +15,16 @@ public class SerializableInterface : ISerializableInterface where TI [HideInInspector, SerializeField] private UnityEngine.Object unityReference; [SerializeReference, UsedImplicitly] private object rawReference; + public SerializableInterface() + { + + } + public SerializableInterface(TInterface value) + { + Value = value; + } + + public TInterface Value { get From 07bc281476623d8fde949face08541e5c4385025 Mon Sep 17 00:00:00 2001 From: Elias Hodel Date: Thu, 5 Oct 2023 11:58:55 +0200 Subject: [PATCH 2/8] Add Extension to Convert Lists and Arrays to SerializableInterfaces --- Runtime/Extensions.cs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Runtime/Extensions.cs b/Runtime/Extensions.cs index d89b03f..23bec07 100644 --- a/Runtime/Extensions.cs +++ b/Runtime/Extensions.cs @@ -1,4 +1,5 @@ using System.Collections.Generic; +using System.Linq; namespace TNRD { @@ -41,5 +42,22 @@ out TInterface value { return IsDefined(serializableInterface, out value); } + + /// + /// Convert a IEnumerable of Interfaces to a List of SerializableInterfaces + /// + public static List> ToSerializableInterfaceList(this IEnumerable list) where T : class + { + return list.Select(e => new SerializableInterface(e) ).ToList(); + } + + /// + /// Convert a IEnumerable of Interfaces to an Array of SerializableInterfaces + /// + public static SerializableInterface[] ToSerializableInterfaceArray(this IEnumerable list) where T : class + { + return list.Select(e => new SerializableInterface(e)).ToArray(); + } + } } From 3810466250d1d0878808a6c3e4682fbe3a48928d Mon Sep 17 00:00:00 2001 From: Elias Hodel Date: Fri, 6 Oct 2023 11:43:23 +0200 Subject: [PATCH 3/8] Only invoke Clicked for Selected Property Only invoke Clicked for a Property if the Mouse is in the Property's Rect. In case that the Property was part of an Array all Array Elements were being pinged. This resulted in Unity ignoring all Pings except the last, so it was basically useless. --- Editor/Drawers/CustomObjectDrawer.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Editor/Drawers/CustomObjectDrawer.cs b/Editor/Drawers/CustomObjectDrawer.cs index 95ac69d..d253881 100644 --- a/Editor/Drawers/CustomObjectDrawer.cs +++ b/Editor/Drawers/CustomObjectDrawer.cs @@ -89,7 +89,10 @@ private void HandleMouseDown(Rect position, Rect positionWithoutThumb, Serialize { isSelected = positionWithoutThumb.Contains(Event.mousePosition); ForceRepaintEditors(); - Clicked?.Invoke(property); + if (isSelected) + { + Clicked?.Invoke(property); + } } else if (Event.button == 1 && positionWithoutThumb.Contains(Event.mousePosition)) { From 41392f9c609431e35cffb076c17f3775b23a3ee3 Mon Sep 17 00:00:00 2001 From: eh-iart <122373308+eh-iart@users.noreply.github.com> Date: Mon, 30 Oct 2023 12:11:59 +0100 Subject: [PATCH 4/8] Apply formatting fixes from code review Co-authored-by: Christiaan Bloemendaal --- Runtime/Extensions.cs | 2 +- Runtime/SerializableInterface.cs | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Runtime/Extensions.cs b/Runtime/Extensions.cs index 23bec07..3cdb0f0 100644 --- a/Runtime/Extensions.cs +++ b/Runtime/Extensions.cs @@ -48,7 +48,7 @@ out TInterface value /// public static List> ToSerializableInterfaceList(this IEnumerable list) where T : class { - return list.Select(e => new SerializableInterface(e) ).ToList(); + return list.Select(e => new SerializableInterface(e)).ToList(); } /// diff --git a/Runtime/SerializableInterface.cs b/Runtime/SerializableInterface.cs index 2c9dd1c..d7641dc 100644 --- a/Runtime/SerializableInterface.cs +++ b/Runtime/SerializableInterface.cs @@ -17,14 +17,12 @@ public class SerializableInterface : ISerializableInterface where TI public SerializableInterface() { - } + public SerializableInterface(TInterface value) { Value = value; } - - public TInterface Value { get From f30c0832005ced77e770d24271a6d78e24c30de6 Mon Sep 17 00:00:00 2001 From: eh-iart <122373308+eh-iart@users.noreply.github.com> Date: Tue, 31 Oct 2023 10:12:03 +0100 Subject: [PATCH 5/8] Apply suggestions from code review Co-authored-by: Christiaan Bloemendaal --- Runtime/Extensions.cs | 1 - Runtime/SerializableInterface.cs | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/Runtime/Extensions.cs b/Runtime/Extensions.cs index 3cdb0f0..f832c89 100644 --- a/Runtime/Extensions.cs +++ b/Runtime/Extensions.cs @@ -58,6 +58,5 @@ public static SerializableInterface[] ToSerializableInterfaceArray(this IE { return list.Select(e => new SerializableInterface(e)).ToArray(); } - } } diff --git a/Runtime/SerializableInterface.cs b/Runtime/SerializableInterface.cs index d7641dc..2376d77 100644 --- a/Runtime/SerializableInterface.cs +++ b/Runtime/SerializableInterface.cs @@ -23,6 +23,7 @@ public SerializableInterface(TInterface value) { Value = value; } + public TInterface Value { get From d5a6da3b59b02e507ee796782765a07ef7d9c004 Mon Sep 17 00:00:00 2001 From: Christiaan Bloemendaal Date: Tue, 7 Nov 2023 18:47:20 +0100 Subject: [PATCH 6/8] feat!: add source generation sample Bumped minimum version to 2021.1 --- .../SerializableInterfaceSourceGeneration.dll | Bin 0 -> 18944 bytes ...alizableInterfaceSourceGeneration.dll.meta | 73 ++++++++++++++++++ package.json | 9 ++- 3 files changed, 81 insertions(+), 1 deletion(-) create mode 100644 Samples~/SourceGeneration/SerializableInterfaceSourceGeneration.dll create mode 100644 Samples~/SourceGeneration/SerializableInterfaceSourceGeneration.dll.meta diff --git a/Samples~/SourceGeneration/SerializableInterfaceSourceGeneration.dll b/Samples~/SourceGeneration/SerializableInterfaceSourceGeneration.dll new file mode 100644 index 0000000000000000000000000000000000000000..4c647b70f9a476116ab3ae43561bf8ee116d61b4 GIT binary patch literal 18944 zcmeHvdz=*YmG7yl?yBnU>1Mhc5anTyJZxu}2?#0>MTTL}F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I zf6U@tUbcHj@Em^lroaif4hFBaq6y3U&7`Y|Uqj(va47E21}5<@H#^m_YjUZ+Wp=i8 zoBIwN-__Wc=N0Iw@=gB*3Z2}vthEy_lH@zt>F!q&=WRW+X$CArMwh-tbKiyWC)Fr7 zNqB7%P_0*J>Ysm)%rD`oMj-=VZdv${?+`Qb>vsIXZy6Nw3qdqZp≫FC#kDaC0VO zU%s?IQ%K`GNiYI!S$yw^uZ6l=i+uyyvvOVN$wVqL{I^GN8r zkCn})zV40GabfeBXPr&%DAp}@N5PSL@Wo#(n;3rdscrvK_r&XnhIjpu@q|ZJKfQn5 z?r`xXR&G%yvlOrOsW;zcFRF@U{kXzP7+=RO87BIi{M+dt6<@!@ZQI^a`3{Ny)6 z)mxV5Z9)3-d|L#)Jhb_RL?3+jv_9EBXYiT26pz*NVuD{qdGVWx*Az2KH^Gm3=$A*w zuca~-5&7ie(S%nH8T`RNu0mB{!G>==(i>-^4|(9o^w4JbM6xJcDZVXt`TRPKee>e! zy+HdU<5%|4sgo7xn_v3$BX5O@sC<%r67r!V9@Tvf&0INeL~|s^&GK@NUn=rTy8%S( g#BDg||9$<{MPP;V@9t{61^2IRfd4(9kBY#50ij^a)&Kwi literal 0 HcmV?d00001 diff --git a/Samples~/SourceGeneration/SerializableInterfaceSourceGeneration.dll.meta b/Samples~/SourceGeneration/SerializableInterfaceSourceGeneration.dll.meta new file mode 100644 index 0000000..6bdbc11 --- /dev/null +++ b/Samples~/SourceGeneration/SerializableInterfaceSourceGeneration.dll.meta @@ -0,0 +1,73 @@ +fileFormatVersion: 2 +guid: 4ac13508a171e574ca523db3ef4cde8c +labels: +- RoslynAnalyzer +- RunOnlyOnAssembliesWithReference +- SourceGenerator +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + : Any + second: + enabled: 0 + settings: + Exclude Editor: 1 + Exclude Linux64: 1 + Exclude OSXUniversal: 1 + Exclude Win: 1 + Exclude Win64: 1 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + - first: + Standalone: Linux64 + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: OSXUniversal + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Win + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Win64 + second: + enabled: 0 + settings: + CPU: None + - first: + Windows Store Apps: WindowsStoreApps + second: + enabled: 0 + settings: + CPU: AnyCPU + userData: + assetBundleName: + assetBundleVariant: diff --git a/package.json b/package.json index 55ec8f7..e47fe1f 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "net.tnrd.serializableinterface", "version": "1.12.1", "displayName": "Serializable Interface", - "unity": "2020.1", + "unity": "2021.1", "description": "A wrapper that allows serialization of interfaces that supports both UnityEngine.Object and regular object types", "keywords": [ "serialize", @@ -134,4 +134,11 @@ ] ] } + "samples": [ + { + "displayName": "Source Generation", + "description": "Contains a dll that will allow you to use source generation", + "path": "Samples~/SourceGeneration" + } + ] } From 0c899564f87715df2b030db4565b2655e47b24d4 Mon Sep 17 00:00:00 2001 From: Christiaan Bloemendaal Date: Tue, 7 Nov 2023 18:47:31 +0100 Subject: [PATCH 7/8] build: updated workflow setup --- .github/FUNDING.yml | 1 + .github/workflows/release.yml | 15 +++-- .releaserc | 112 +++++++++++++++++++++++++++++++ package.json | 120 ---------------------------------- 4 files changed, 121 insertions(+), 127 deletions(-) create mode 100644 .github/FUNDING.yml create mode 100644 .releaserc diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..49ddb5e --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1 @@ + ko_fi: thundernerd \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c8a3874..e9f2a85 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,17 +8,13 @@ jobs: name: Release runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@v3 - with: - token: ${{ secrets.GH_TOKEN }} - name: Setup Node.js uses: actions/setup-node@v2 with: node-version: 'lts/*' - name: Install dependencies - run: > - npm install + run: > + npm install -g --save false semantic-release @semantic-release/changelog @semantic-release/commit-analyzer @@ -27,8 +23,13 @@ jobs: @semantic-release/npm @semantic-release/release-notes-generator conventional-changelog-conventionalcommits + - name: Checkout + uses: actions/checkout@v3 + with: + token: ${{ secrets.GH_TOKEN }} - name: Release env: GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - run: npx semantic-release + NPM_CONFIG_REGISTRY: 'https://npm.pkg.github.com/@Thundernerd' + run: npx semantic-release \ No newline at end of file diff --git a/.releaserc b/.releaserc new file mode 100644 index 0000000..4a637a1 --- /dev/null +++ b/.releaserc @@ -0,0 +1,112 @@ +{ + "branches": + [ + "main" + ], + "plugins": + [ + [ + "@semantic-release/commit-analyzer", + { + "preset": "conventionalcommits", + "releaseRules": + [ + { + "breaking": true, + "release": "major" + }, + { + "type": "docs", + "scope": "README", + "release": "patch" + }, + { + "type": "refactor", + "release": "patch" + }, + { + "scope": "no-release", + "release": false + } + ], + "parserOpts": + { + "noteKeywords": + [ + "BREAKING CHANGE", + "BREAKING CHANGES" + ] + } + } + ], + [ + "@semantic-release/npm", + { + "npmPublish": true + } + ], + "@semantic-release/github", + [ + "@semantic-release/release-notes-generator", + { + "preset": "conventionalcommits", + "presetConfig": + { + "types": + [ + { + "type": "feat", + "section": "Features" + }, + { + "type": "fix", + "section": "Bug Fixes" + }, + { + "type": "chore", + "hidden": true + }, + { + "type": "docs", + "section": "Documentation" + }, + { + "type": "style", + "hidden": true + }, + { + "type": "refactor", + "section": "Refactors" + }, + { + "type": "perf", + "section": "Performance Improvements" + }, + { + "type": "test", + "section": "Tests" + } + ] + } + } + ], + [ + "@semantic-release/changelog", + { + "changelogFile": "CHANGELOG.md" + } + ], + [ + "@semantic-release/git", + { + "assets": + [ + "package.json", + "!package-lock.json.meta", + "CHANGELOG.md" + ], + "message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}" + } + ] + ] +} diff --git a/package.json b/package.json index e47fe1f..6a30fb7 100644 --- a/package.json +++ b/package.json @@ -14,126 +14,6 @@ "name": "TNRD", "url": "https://www.tnrd.net" }, - "scripts": { - "semantic-release": "semantic-release" - }, - "repository": { - "type": "git", - "url": "https://github.com/Thundernerd/Unity3D-SerializableInterface.git" - }, - "publishConfig": { - "registry": "https://npm.pkg.github.com/@Thundernerd" - }, - "devDependencies": { - "@semantic-release/changelog": "^6.0.1", - "@semantic-release/commit-analyzer": "^9.0.2", - "@semantic-release/git": "^10.0.1", - "@semantic-release/github": "^8.0.6", - "@semantic-release/npm": "^9.0.1", - "@semantic-release/release-notes-generator": "^10.0.3", - "conventional-changelog-conventionalcommits": "^4.6.3", - "semantic-release": "^19.0.5" - }, - "release": { - "branches": [ - "main" - ], - "plugins": [ - [ - "@semantic-release/commit-analyzer", - { - "preset": "conventionalcommits", - "releaseRules": [ - { - "type": "docs", - "scope": "README", - "release": "patch" - }, - { - "type": "refactor", - "release": "patch" - }, - { - "scope": "no-release", - "release": false - } - ], - "parserOpts": { - "noteKeywords": [ - "BREAKING CHANGE", - "BREAKING CHANGES" - ] - } - } - ], - [ - "@semantic-release/npm", - { - "npmPublish": true - } - ], - "@semantic-release/github", - [ - "@semantic-release/release-notes-generator", - { - "preset": "conventionalcommits", - "presetConfig": { - "types": [ - { - "type": "feat", - "section": "Features" - }, - { - "type": "fix", - "section": "Bug Fixes" - }, - { - "type": "chore", - "hidden": true - }, - { - "type": "docs", - "section": "Documentation" - }, - { - "type": "style", - "hidden": true - }, - { - "type": "refactor", - "section": "Refactors" - }, - { - "type": "perf", - "section": "Performance Improvements" - }, - { - "type": "test", - "section": "Tests" - } - ] - } - } - ], - [ - "@semantic-release/changelog", - { - "changelogFile": "CHANGELOG.md" - } - ], - [ - "@semantic-release/git", - { - "assets": [ - "package.json", - "!package-lock.json.meta", - "CHANGELOG.md" - ], - "message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}" - } - ] - ] - } "samples": [ { "displayName": "Source Generation", From 809922dda5c3ad32820652b1950903580c4f6f91 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Tue, 7 Nov 2023 18:11:40 +0000 Subject: [PATCH 8/8] chore(release): 2.0.0 [skip ci] MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## [2.0.0](https://github.com/Thundernerd/Unity3D-SerializableInterface/compare/v1.12.1...v2.0.0) (2023-11-07) ### ⚠ BREAKING CHANGES * add source generation sample ### Features * add source generation sample ([d5a6da3](https://github.com/Thundernerd/Unity3D-SerializableInterface/commit/d5a6da3b59b02e507ee796782765a07ef7d9c004)) --- CHANGELOG.md | 11 +++++++++++ package.json | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6533c43..5ed747d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,14 @@ +## [2.0.0](https://github.com/Thundernerd/Unity3D-SerializableInterface/compare/v1.12.1...v2.0.0) (2023-11-07) + + +### ⚠ BREAKING CHANGES + +* add source generation sample + +### Features + +* add source generation sample ([d5a6da3](https://github.com/Thundernerd/Unity3D-SerializableInterface/commit/d5a6da3b59b02e507ee796782765a07ef7d9c004)) + ### [1.12.1](https://github.com/Thundernerd/Unity3D-SerializableInterface/compare/v1.12.0...v1.12.1) (2022-09-10) diff --git a/package.json b/package.json index 6a30fb7..46c6272 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "net.tnrd.serializableinterface", - "version": "1.12.1", + "version": "2.0.0", "displayName": "Serializable Interface", "unity": "2021.1", "description": "A wrapper that allows serialization of interfaces that supports both UnityEngine.Object and regular object types",