From 4cd1dd47634e1d981aa9be7f8dc72748bd0ba212 Mon Sep 17 00:00:00 2001 From: Brian Bird Date: Thu, 30 Sep 2021 18:19:08 -0400 Subject: [PATCH 1/7] Folder attempted fix --- .../.idea.spacebrewUnity.dir/.idea/.gitignore | 13 +++++ .../.idea/encodings.xml | 4 ++ .../.idea/indexLayout.xml | 8 +++ .idea/.idea.spacebrewUnity.dir/.idea/vcs.xml | 6 +++ .../{ => Editor}/SBCustomTypeAttribute.cs | 50 +++++++++---------- .../SBCustomTypeAttribute.cs.meta | 0 .../SBCustomTypePropertyDrawer.cs | 0 .../SBCustomTypePropertyDrawer.cs.meta | 0 Runtime/Scripts/SpacebrewClient.cs | 4 ++ 9 files changed, 60 insertions(+), 25 deletions(-) create mode 100644 .idea/.idea.spacebrewUnity.dir/.idea/.gitignore create mode 100644 .idea/.idea.spacebrewUnity.dir/.idea/encodings.xml create mode 100644 .idea/.idea.spacebrewUnity.dir/.idea/indexLayout.xml create mode 100644 .idea/.idea.spacebrewUnity.dir/.idea/vcs.xml rename Runtime/Scripts/{ => Editor}/SBCustomTypeAttribute.cs (96%) rename Runtime/Scripts/{ => Editor}/SBCustomTypeAttribute.cs.meta (100%) rename Runtime/Scripts/{ => Editor}/SBCustomTypePropertyDrawer.cs (100%) rename Runtime/Scripts/{ => Editor}/SBCustomTypePropertyDrawer.cs.meta (100%) diff --git a/.idea/.idea.spacebrewUnity.dir/.idea/.gitignore b/.idea/.idea.spacebrewUnity.dir/.idea/.gitignore new file mode 100644 index 0000000..a2f520c --- /dev/null +++ b/.idea/.idea.spacebrewUnity.dir/.idea/.gitignore @@ -0,0 +1,13 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Rider ignored files +/contentModel.xml +/.idea.spacebrewUnity.iml +/modules.xml +/projectSettingsUpdater.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/.idea.spacebrewUnity.dir/.idea/encodings.xml b/.idea/.idea.spacebrewUnity.dir/.idea/encodings.xml new file mode 100644 index 0000000..df87cf9 --- /dev/null +++ b/.idea/.idea.spacebrewUnity.dir/.idea/encodings.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/.idea.spacebrewUnity.dir/.idea/indexLayout.xml b/.idea/.idea.spacebrewUnity.dir/.idea/indexLayout.xml new file mode 100644 index 0000000..7b08163 --- /dev/null +++ b/.idea/.idea.spacebrewUnity.dir/.idea/indexLayout.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/.idea.spacebrewUnity.dir/.idea/vcs.xml b/.idea/.idea.spacebrewUnity.dir/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/.idea.spacebrewUnity.dir/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Runtime/Scripts/SBCustomTypeAttribute.cs b/Runtime/Scripts/Editor/SBCustomTypeAttribute.cs similarity index 96% rename from Runtime/Scripts/SBCustomTypeAttribute.cs rename to Runtime/Scripts/Editor/SBCustomTypeAttribute.cs index eedaacf..9eb9e92 100644 --- a/Runtime/Scripts/SBCustomTypeAttribute.cs +++ b/Runtime/Scripts/Editor/SBCustomTypeAttribute.cs @@ -1,25 +1,25 @@ -using UnityEngine; -using System; -using System.Collections; - -//Original version of the ConditionalHideAttribute created by Brecht Lecluyse (www.brechtos.com) -//Modified by: Quin Kennedy - -[AttributeUsage(AttributeTargets.Field | AttributeTargets.Property | - AttributeTargets.Class | AttributeTargets.Struct, Inherited = true)] -public class SBCustomTypeAttribute : PropertyAttribute -{ - public string ConditionalSourceField = ""; - public bool Inverse = false; - - // Use this for initialization - public SBCustomTypeAttribute(string conditionalSourceField, bool inverse) - { - this.ConditionalSourceField = conditionalSourceField; - this.Inverse = inverse; - } - -} - - - +using UnityEngine; +using System; +using System.Collections; + +//Original version of the ConditionalHideAttribute created by Brecht Lecluyse (www.brechtos.com) +//Modified by: Quin Kennedy + +[AttributeUsage(AttributeTargets.Field | AttributeTargets.Property | + AttributeTargets.Class | AttributeTargets.Struct, Inherited = true)] +public class SBCustomTypeAttribute : PropertyAttribute +{ + public string ConditionalSourceField = ""; + public bool Inverse = false; + + // Use this for initialization + public SBCustomTypeAttribute(string conditionalSourceField, bool inverse) + { + this.ConditionalSourceField = conditionalSourceField; + this.Inverse = inverse; + } + +} + + + diff --git a/Runtime/Scripts/SBCustomTypeAttribute.cs.meta b/Runtime/Scripts/Editor/SBCustomTypeAttribute.cs.meta similarity index 100% rename from Runtime/Scripts/SBCustomTypeAttribute.cs.meta rename to Runtime/Scripts/Editor/SBCustomTypeAttribute.cs.meta diff --git a/Runtime/Scripts/SBCustomTypePropertyDrawer.cs b/Runtime/Scripts/Editor/SBCustomTypePropertyDrawer.cs similarity index 100% rename from Runtime/Scripts/SBCustomTypePropertyDrawer.cs rename to Runtime/Scripts/Editor/SBCustomTypePropertyDrawer.cs diff --git a/Runtime/Scripts/SBCustomTypePropertyDrawer.cs.meta b/Runtime/Scripts/Editor/SBCustomTypePropertyDrawer.cs.meta similarity index 100% rename from Runtime/Scripts/SBCustomTypePropertyDrawer.cs.meta rename to Runtime/Scripts/Editor/SBCustomTypePropertyDrawer.cs.meta diff --git a/Runtime/Scripts/SpacebrewClient.cs b/Runtime/Scripts/SpacebrewClient.cs index 5a271ba..48588a8 100644 --- a/Runtime/Scripts/SpacebrewClient.cs +++ b/Runtime/Scripts/SpacebrewClient.cs @@ -26,7 +26,9 @@ public class Publisher { public string name; public type pubType; +#if UNITY_EDITOR [SBCustomType("pubType", false)] +#endif public string customType; //public string defaultValue; @@ -50,7 +52,9 @@ public class Subscriber { public string name; public type subType; +#if UNITY_EDITOR [SBCustomType("subType", false)] +#endif public string customType; public SpacebrewMessageEvent onReceived; From ef343194ad242beeda228af3f5e4d73f5da4626a Mon Sep 17 00:00:00 2001 From: Brian Bird Date: Thu, 30 Sep 2021 18:29:14 -0400 Subject: [PATCH 2/7] Added Editor.meta --- Runtime/Scripts/Editor.meta | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 Runtime/Scripts/Editor.meta diff --git a/Runtime/Scripts/Editor.meta b/Runtime/Scripts/Editor.meta new file mode 100644 index 0000000..9687c81 --- /dev/null +++ b/Runtime/Scripts/Editor.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: fe3c98387cee54896a45eac1982aaba1 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: From 2ec90e75733674e13da5ec9af15db85f6b3316a3 Mon Sep 17 00:00:00 2001 From: Brian Bird Date: Thu, 30 Sep 2021 18:42:52 -0400 Subject: [PATCH 3/7] Added editor assembly def --- Runtime/Scripts/Editor/Spacebrew.Editor.asmdef | 16 ++++++++++++++++ .../Scripts/Editor/Spacebrew.Editor.asmdef.meta | 7 +++++++ 2 files changed, 23 insertions(+) create mode 100644 Runtime/Scripts/Editor/Spacebrew.Editor.asmdef create mode 100644 Runtime/Scripts/Editor/Spacebrew.Editor.asmdef.meta diff --git a/Runtime/Scripts/Editor/Spacebrew.Editor.asmdef b/Runtime/Scripts/Editor/Spacebrew.Editor.asmdef new file mode 100644 index 0000000..5f26971 --- /dev/null +++ b/Runtime/Scripts/Editor/Spacebrew.Editor.asmdef @@ -0,0 +1,16 @@ +{ + "name": "Spacebrew.Editor", + "references": [ + ], + "includePlatforms": [ + "Editor" + ], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [], + "versionDefines": [], + "noEngineReferences": false +} \ No newline at end of file diff --git a/Runtime/Scripts/Editor/Spacebrew.Editor.asmdef.meta b/Runtime/Scripts/Editor/Spacebrew.Editor.asmdef.meta new file mode 100644 index 0000000..9b2d8ce --- /dev/null +++ b/Runtime/Scripts/Editor/Spacebrew.Editor.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: d977e068e68d244b2a22fcd198215890 +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: From d3229a0df9259c63ad85dd0f4d7c1f07cf7bad4c Mon Sep 17 00:00:00 2001 From: Brian Bird Date: Thu, 30 Sep 2021 18:53:15 -0400 Subject: [PATCH 4/7] Attempted reshuffle --- .../Scripts/Editor => Editor}/SBCustomTypeAttribute.cs | 0 .../Editor => Editor}/SBCustomTypeAttribute.cs.meta | 0 .../Editor => Editor}/SBCustomTypePropertyDrawer.cs | 0 .../Editor => Editor}/SBCustomTypePropertyDrawer.cs.meta | 0 .../Scripts/Editor => Editor}/Spacebrew.Editor.asmdef | 2 ++ .../Editor => Editor}/Spacebrew.Editor.asmdef.meta | 0 Runtime/Scripts/Editor.meta | 8 -------- Spacebrew.asmdef => Runtime/Spacebrew.Runtime.asmdef | 3 +-- .../Spacebrew.Runtime.asmdef.meta | 0 9 files changed, 3 insertions(+), 10 deletions(-) rename {Runtime/Scripts/Editor => Editor}/SBCustomTypeAttribute.cs (100%) rename {Runtime/Scripts/Editor => Editor}/SBCustomTypeAttribute.cs.meta (100%) rename {Runtime/Scripts/Editor => Editor}/SBCustomTypePropertyDrawer.cs (100%) rename {Runtime/Scripts/Editor => Editor}/SBCustomTypePropertyDrawer.cs.meta (100%) rename {Runtime/Scripts/Editor => Editor}/Spacebrew.Editor.asmdef (88%) rename {Runtime/Scripts/Editor => Editor}/Spacebrew.Editor.asmdef.meta (100%) delete mode 100644 Runtime/Scripts/Editor.meta rename Spacebrew.asmdef => Runtime/Spacebrew.Runtime.asmdef (87%) rename Spacebrew.asmdef.meta => Runtime/Spacebrew.Runtime.asmdef.meta (100%) diff --git a/Runtime/Scripts/Editor/SBCustomTypeAttribute.cs b/Editor/SBCustomTypeAttribute.cs similarity index 100% rename from Runtime/Scripts/Editor/SBCustomTypeAttribute.cs rename to Editor/SBCustomTypeAttribute.cs diff --git a/Runtime/Scripts/Editor/SBCustomTypeAttribute.cs.meta b/Editor/SBCustomTypeAttribute.cs.meta similarity index 100% rename from Runtime/Scripts/Editor/SBCustomTypeAttribute.cs.meta rename to Editor/SBCustomTypeAttribute.cs.meta diff --git a/Runtime/Scripts/Editor/SBCustomTypePropertyDrawer.cs b/Editor/SBCustomTypePropertyDrawer.cs similarity index 100% rename from Runtime/Scripts/Editor/SBCustomTypePropertyDrawer.cs rename to Editor/SBCustomTypePropertyDrawer.cs diff --git a/Runtime/Scripts/Editor/SBCustomTypePropertyDrawer.cs.meta b/Editor/SBCustomTypePropertyDrawer.cs.meta similarity index 100% rename from Runtime/Scripts/Editor/SBCustomTypePropertyDrawer.cs.meta rename to Editor/SBCustomTypePropertyDrawer.cs.meta diff --git a/Runtime/Scripts/Editor/Spacebrew.Editor.asmdef b/Editor/Spacebrew.Editor.asmdef similarity index 88% rename from Runtime/Scripts/Editor/Spacebrew.Editor.asmdef rename to Editor/Spacebrew.Editor.asmdef index 5f26971..5d8f4ac 100644 --- a/Runtime/Scripts/Editor/Spacebrew.Editor.asmdef +++ b/Editor/Spacebrew.Editor.asmdef @@ -1,6 +1,8 @@ { "name": "Spacebrew.Editor", "references": [ + "Runtime", + "Runtime.Scripts" ], "includePlatforms": [ "Editor" diff --git a/Runtime/Scripts/Editor/Spacebrew.Editor.asmdef.meta b/Editor/Spacebrew.Editor.asmdef.meta similarity index 100% rename from Runtime/Scripts/Editor/Spacebrew.Editor.asmdef.meta rename to Editor/Spacebrew.Editor.asmdef.meta diff --git a/Runtime/Scripts/Editor.meta b/Runtime/Scripts/Editor.meta deleted file mode 100644 index 9687c81..0000000 --- a/Runtime/Scripts/Editor.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: fe3c98387cee54896a45eac1982aaba1 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Spacebrew.asmdef b/Runtime/Spacebrew.Runtime.asmdef similarity index 87% rename from Spacebrew.asmdef rename to Runtime/Spacebrew.Runtime.asmdef index cccadc4..675fc4d 100644 --- a/Spacebrew.asmdef +++ b/Runtime/Spacebrew.Runtime.asmdef @@ -1,7 +1,6 @@ { - "name": "Spacebrew", + "name": "Spacebrew.Runtime", "references": [ - "Runtime", "Scripts" ], "includePlatforms": [], diff --git a/Spacebrew.asmdef.meta b/Runtime/Spacebrew.Runtime.asmdef.meta similarity index 100% rename from Spacebrew.asmdef.meta rename to Runtime/Spacebrew.Runtime.asmdef.meta From c3da1f00c69d96bc2d72293553288b83bf93b5cc Mon Sep 17 00:00:00 2001 From: Brian Bird Date: Thu, 30 Sep 2021 18:58:07 -0400 Subject: [PATCH 5/7] Add paths to new asmdefs --- Editor.meta | 8 ++++++++ Editor/SBCustomTypeAttribute.cs | 1 + Editor/SBCustomTypePropertyDrawer.cs | 1 + Runtime/Scripts/SpacebrewClient.cs | 4 ++++ 4 files changed, 14 insertions(+) create mode 100644 Editor.meta diff --git a/Editor.meta b/Editor.meta new file mode 100644 index 0000000..9687c81 --- /dev/null +++ b/Editor.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: fe3c98387cee54896a45eac1982aaba1 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Editor/SBCustomTypeAttribute.cs b/Editor/SBCustomTypeAttribute.cs index 9eb9e92..8373498 100644 --- a/Editor/SBCustomTypeAttribute.cs +++ b/Editor/SBCustomTypeAttribute.cs @@ -1,6 +1,7 @@ using UnityEngine; using System; using System.Collections; +using Spacebrew.Runtime; //Original version of the ConditionalHideAttribute created by Brecht Lecluyse (www.brechtos.com) //Modified by: Quin Kennedy diff --git a/Editor/SBCustomTypePropertyDrawer.cs b/Editor/SBCustomTypePropertyDrawer.cs index 0078679..f87a592 100644 --- a/Editor/SBCustomTypePropertyDrawer.cs +++ b/Editor/SBCustomTypePropertyDrawer.cs @@ -1,6 +1,7 @@ using UnityEngine; using UnityEditor; using System.Collections.Generic; +using Spacebrew.Runtime; //Original version of the ConditionalHideAttribute created by Brecht Lecluyse (www.brechtos.com) //Modified by: Quin Kennedy diff --git a/Runtime/Scripts/SpacebrewClient.cs b/Runtime/Scripts/SpacebrewClient.cs index 48588a8..0dbed15 100644 --- a/Runtime/Scripts/SpacebrewClient.cs +++ b/Runtime/Scripts/SpacebrewClient.cs @@ -7,6 +7,10 @@ using SimpleJSON; using UnityEngine.Events; +#if UNITY_EDITOR +using Spacebrew.Editor; +#endif + public class SpacebrewClient : MonoBehaviour { From 6cea4bc0da1af5faa07c99d4b5fa9775a8c6fee6 Mon Sep 17 00:00:00 2001 From: Brian Bird Date: Thu, 30 Sep 2021 19:14:01 -0400 Subject: [PATCH 6/7] Added UNITY_EDITOR checks --- .gitignore | 2 +- Runtime/Scripts/SBCustomTypeAttribute.cs | 7 +++---- Runtime/Scripts/SBCustomTypePropertyDrawer.cs | 5 ++++- Runtime/Scripts/SpacebrewClient.cs | 4 ++++ 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 94c8b55..19732e3 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,7 @@ .DS_Store .AppleDouble .LSOverride - +.idea # Icon must end with two \r Icon diff --git a/Runtime/Scripts/SBCustomTypeAttribute.cs b/Runtime/Scripts/SBCustomTypeAttribute.cs index eedaacf..fe30bce 100644 --- a/Runtime/Scripts/SBCustomTypeAttribute.cs +++ b/Runtime/Scripts/SBCustomTypeAttribute.cs @@ -1,4 +1,5 @@ -using UnityEngine; +#if UNITY_EDITOR +using UnityEngine; using System; using System.Collections; @@ -20,6 +21,4 @@ public SBCustomTypeAttribute(string conditionalSourceField, bool inverse) } } - - - +#endif \ No newline at end of file diff --git a/Runtime/Scripts/SBCustomTypePropertyDrawer.cs b/Runtime/Scripts/SBCustomTypePropertyDrawer.cs index 0078679..6e663c8 100644 --- a/Runtime/Scripts/SBCustomTypePropertyDrawer.cs +++ b/Runtime/Scripts/SBCustomTypePropertyDrawer.cs @@ -1,4 +1,6 @@ -using UnityEngine; +#if UNITY_EDITOR + +using UnityEngine; using UnityEditor; using System.Collections.Generic; @@ -86,3 +88,4 @@ private bool GetConditionalHideAttributeResult(SBCustomTypeAttribute condHAtt, S return enabled; } } +#endif \ No newline at end of file diff --git a/Runtime/Scripts/SpacebrewClient.cs b/Runtime/Scripts/SpacebrewClient.cs index 5a271ba..48588a8 100644 --- a/Runtime/Scripts/SpacebrewClient.cs +++ b/Runtime/Scripts/SpacebrewClient.cs @@ -26,7 +26,9 @@ public class Publisher { public string name; public type pubType; +#if UNITY_EDITOR [SBCustomType("pubType", false)] +#endif public string customType; //public string defaultValue; @@ -50,7 +52,9 @@ public class Subscriber { public string name; public type subType; +#if UNITY_EDITOR [SBCustomType("subType", false)] +#endif public string customType; public SpacebrewMessageEvent onReceived; From e7c8845b0dd0add6e2eab5f112f63a3e4faa4d1c Mon Sep 17 00:00:00 2001 From: Brian Bird Date: Thu, 30 Sep 2021 19:20:47 -0400 Subject: [PATCH 7/7] Squashed commit of the following: commit 6cea4bc0da1af5faa07c99d4b5fa9775a8c6fee6 Author: Brian Bird Date: Thu Sep 30 19:14:01 2021 -0400 Added UNITY_EDITOR checks --- .gitignore | 2 +- Editor/SBCustomTypeAttribute.cs | 8 +++----- Editor/SBCustomTypePropertyDrawer.cs | 5 ++++- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index 94c8b55..19732e3 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,7 @@ .DS_Store .AppleDouble .LSOverride - +.idea # Icon must end with two \r Icon diff --git a/Editor/SBCustomTypeAttribute.cs b/Editor/SBCustomTypeAttribute.cs index 8373498..640192d 100644 --- a/Editor/SBCustomTypeAttribute.cs +++ b/Editor/SBCustomTypeAttribute.cs @@ -1,7 +1,7 @@ -using UnityEngine; +#if UNITY_EDITOR +using UnityEngine; using System; using System.Collections; -using Spacebrew.Runtime; //Original version of the ConditionalHideAttribute created by Brecht Lecluyse (www.brechtos.com) //Modified by: Quin Kennedy @@ -21,6 +21,4 @@ public SBCustomTypeAttribute(string conditionalSourceField, bool inverse) } } - - - +#endif diff --git a/Editor/SBCustomTypePropertyDrawer.cs b/Editor/SBCustomTypePropertyDrawer.cs index f87a592..1d9a5f1 100644 --- a/Editor/SBCustomTypePropertyDrawer.cs +++ b/Editor/SBCustomTypePropertyDrawer.cs @@ -1,4 +1,6 @@ -using UnityEngine; +#if UNITY_EDITOR + +using UnityEngine; using UnityEditor; using System.Collections.Generic; using Spacebrew.Runtime; @@ -87,3 +89,4 @@ private bool GetConditionalHideAttributeResult(SBCustomTypeAttribute condHAtt, S return enabled; } } +#endif \ No newline at end of file