From cbc1dbf59ecc4acaf5391fb80c5f2baac6178996 Mon Sep 17 00:00:00 2001 From: Sercan Altundas Date: Tue, 4 Jul 2023 00:08:15 +0300 Subject: [PATCH 1/7] chore: cleanup mic refs in webgl --- Runtime/OpenAIApi.cs | 2 +- Samples~/Whisper/Whisper.cs | 15 ++++++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/Runtime/OpenAIApi.cs b/Runtime/OpenAIApi.cs index 2e479f0..2c4b0f6 100644 --- a/Runtime/OpenAIApi.cs +++ b/Runtime/OpenAIApi.cs @@ -164,7 +164,7 @@ private async Task DispatchRequest(string path, List Date: Tue, 4 Jul 2023 13:56:26 +0300 Subject: [PATCH 2/7] feat: linker --- Resources.meta | 8 ++++++++ Resources/OpenAI.Runtime.xml | 3 +++ Resources/OpenAI.Runtime.xml.meta | 7 +++++++ 3 files changed, 18 insertions(+) create mode 100644 Resources.meta create mode 100644 Resources/OpenAI.Runtime.xml create mode 100644 Resources/OpenAI.Runtime.xml.meta diff --git a/Resources.meta b/Resources.meta new file mode 100644 index 0000000..7115bc5 --- /dev/null +++ b/Resources.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ba44b2fed7b7e2746bd1897059372d5b +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/OpenAI.Runtime.xml b/Resources/OpenAI.Runtime.xml new file mode 100644 index 0000000..e895b9a --- /dev/null +++ b/Resources/OpenAI.Runtime.xml @@ -0,0 +1,3 @@ + + + diff --git a/Resources/OpenAI.Runtime.xml.meta b/Resources/OpenAI.Runtime.xml.meta new file mode 100644 index 0000000..3464897 --- /dev/null +++ b/Resources/OpenAI.Runtime.xml.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 1c19667dc37e55a40868e4cd62e4e18d +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: From b350c1096807a314851fdc356b87b85b453f456b Mon Sep 17 00:00:00 2001 From: Sercan Altundas Date: Tue, 4 Jul 2023 15:07:09 +0300 Subject: [PATCH 3/7] feat: link xml transferer --- Editor.meta | 8 +++++++ Editor/LinkXmlTransferer.cs | 21 +++++++++++++++++++ Editor/LinkXmlTransferer.cs.meta | 11 ++++++++++ Editor/OpenAI.Editor.asmdef | 16 ++++++++++++++ .../OpenAI.Editor.asmdef.meta | 4 ++-- Resources/OpenAI.Runtime.xml | 3 --- Resources/link.xml | 3 +++ Resources/link.xml.meta | 3 +++ 8 files changed, 64 insertions(+), 5 deletions(-) create mode 100644 Editor.meta create mode 100644 Editor/LinkXmlTransferer.cs create mode 100644 Editor/LinkXmlTransferer.cs.meta create mode 100644 Editor/OpenAI.Editor.asmdef rename Resources/OpenAI.Runtime.xml.meta => Editor/OpenAI.Editor.asmdef.meta (59%) delete mode 100644 Resources/OpenAI.Runtime.xml create mode 100644 Resources/link.xml create mode 100644 Resources/link.xml.meta diff --git a/Editor.meta b/Editor.meta new file mode 100644 index 0000000..ff7f6df --- /dev/null +++ b/Editor.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ac64a64a24d499f4e87fff134f32de9e +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Editor/LinkXmlTransferer.cs b/Editor/LinkXmlTransferer.cs new file mode 100644 index 0000000..5d3faf6 --- /dev/null +++ b/Editor/LinkXmlTransferer.cs @@ -0,0 +1,21 @@ +using System.IO; +using UnityEditor; +using UnityEditor.Build; +using UnityEditor.UnityLinker; +using UnityEditor.Build.Reporting; + +namespace OpenAI +{ + public class LinkXmlTransferer : IUnityLinkerProcessor + { + int IOrderedCallback.callbackOrder => 0; + string IUnityLinkerProcessor.GenerateAdditionalLinkXmlFile(BuildReport report, UnityLinkerBuildPipelineData data) + { + string linkXmlGuid = AssetDatabase.FindAssets("link.xml")[0]; + string linkXmlPath = AssetDatabase.GUIDToAssetPath(linkXmlGuid); + return Path.GetFullPath(linkXmlPath); + } + void IUnityLinkerProcessor.OnBeforeRun(BuildReport report, UnityLinkerBuildPipelineData data) { } + void IUnityLinkerProcessor.OnAfterRun(BuildReport report, UnityLinkerBuildPipelineData data) { } + } +} diff --git a/Editor/LinkXmlTransferer.cs.meta b/Editor/LinkXmlTransferer.cs.meta new file mode 100644 index 0000000..a7c6624 --- /dev/null +++ b/Editor/LinkXmlTransferer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2eb77ad81feeacd489b2009ae364fb18 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Editor/OpenAI.Editor.asmdef b/Editor/OpenAI.Editor.asmdef new file mode 100644 index 0000000..c73561c --- /dev/null +++ b/Editor/OpenAI.Editor.asmdef @@ -0,0 +1,16 @@ +{ + "name": "OpenAI.Editor", + "rootNamespace": "", + "references": [], + "includePlatforms": [ + "Editor" + ], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [], + "versionDefines": [], + "noEngineReferences": false +} \ No newline at end of file diff --git a/Resources/OpenAI.Runtime.xml.meta b/Editor/OpenAI.Editor.asmdef.meta similarity index 59% rename from Resources/OpenAI.Runtime.xml.meta rename to Editor/OpenAI.Editor.asmdef.meta index 3464897..b31c3fd 100644 --- a/Resources/OpenAI.Runtime.xml.meta +++ b/Editor/OpenAI.Editor.asmdef.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 -guid: 1c19667dc37e55a40868e4cd62e4e18d -TextScriptImporter: +guid: 640ea5081a1d0f6468d38f2d52808a5a +AssemblyDefinitionImporter: externalObjects: {} userData: assetBundleName: diff --git a/Resources/OpenAI.Runtime.xml b/Resources/OpenAI.Runtime.xml deleted file mode 100644 index e895b9a..0000000 --- a/Resources/OpenAI.Runtime.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/Resources/link.xml b/Resources/link.xml new file mode 100644 index 0000000..dd12640 --- /dev/null +++ b/Resources/link.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/Resources/link.xml.meta b/Resources/link.xml.meta new file mode 100644 index 0000000..3192a2f --- /dev/null +++ b/Resources/link.xml.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 26ca615622ff42e58e13b7249aaa56d6 +timeCreated: 1688470534 \ No newline at end of file From 57b11f5dba24e9ac103a44c87a0d27810604b045 Mon Sep 17 00:00:00 2001 From: Sercan Altundas Date: Tue, 4 Jul 2023 15:12:25 +0300 Subject: [PATCH 4/7] Update LinkXmlTransferer.cs --- Editor/LinkXmlTransferer.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Editor/LinkXmlTransferer.cs b/Editor/LinkXmlTransferer.cs index 5d3faf6..f004740 100644 --- a/Editor/LinkXmlTransferer.cs +++ b/Editor/LinkXmlTransferer.cs @@ -9,13 +9,16 @@ namespace OpenAI public class LinkXmlTransferer : IUnityLinkerProcessor { int IOrderedCallback.callbackOrder => 0; - string IUnityLinkerProcessor.GenerateAdditionalLinkXmlFile(BuildReport report, UnityLinkerBuildPipelineData data) + + public string GenerateAdditionalLinkXmlFile(BuildReport report, UnityLinkerBuildPipelineData data) { string linkXmlGuid = AssetDatabase.FindAssets("link.xml")[0]; string linkXmlPath = AssetDatabase.GUIDToAssetPath(linkXmlGuid); return Path.GetFullPath(linkXmlPath); } - void IUnityLinkerProcessor.OnBeforeRun(BuildReport report, UnityLinkerBuildPipelineData data) { } - void IUnityLinkerProcessor.OnAfterRun(BuildReport report, UnityLinkerBuildPipelineData data) { } + + public void OnBeforeRun(BuildReport report, UnityLinkerBuildPipelineData data) { } + + public void OnAfterRun(BuildReport report, UnityLinkerBuildPipelineData data) { } } } From 8a9f8fc1ff7af22f72731f4a4bd9168fe82430a4 Mon Sep 17 00:00:00 2001 From: Sercan Altundas Date: Tue, 4 Jul 2023 17:22:32 +0300 Subject: [PATCH 5/7] feat: linkxml in a folder to find easier --- Editor/LinkXmlTransferer.cs | 4 ++-- Resources/LinkXml.meta | 8 ++++++++ Resources/{ => LinkXml}/link.xml | 0 Resources/{ => LinkXml}/link.xml.meta | 0 Samples.meta | 8 ++++++++ 5 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 Resources/LinkXml.meta rename Resources/{ => LinkXml}/link.xml (100%) rename Resources/{ => LinkXml}/link.xml.meta (100%) create mode 100644 Samples.meta diff --git a/Editor/LinkXmlTransferer.cs b/Editor/LinkXmlTransferer.cs index f004740..2310ab0 100644 --- a/Editor/LinkXmlTransferer.cs +++ b/Editor/LinkXmlTransferer.cs @@ -12,8 +12,8 @@ public class LinkXmlTransferer : IUnityLinkerProcessor public string GenerateAdditionalLinkXmlFile(BuildReport report, UnityLinkerBuildPipelineData data) { - string linkXmlGuid = AssetDatabase.FindAssets("link.xml")[0]; - string linkXmlPath = AssetDatabase.GUIDToAssetPath(linkXmlGuid); + string[] linkXmlGuid = AssetDatabase.FindAssets("link", new string[] { "Assets/Resources/LinkXml" }); + string linkXmlPath = AssetDatabase.GUIDToAssetPath(linkXmlGuid[0]); return Path.GetFullPath(linkXmlPath); } diff --git a/Resources/LinkXml.meta b/Resources/LinkXml.meta new file mode 100644 index 0000000..e73e14c --- /dev/null +++ b/Resources/LinkXml.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 60d29a3b6d57bf640b309d06961657b7 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Resources/link.xml b/Resources/LinkXml/link.xml similarity index 100% rename from Resources/link.xml rename to Resources/LinkXml/link.xml diff --git a/Resources/link.xml.meta b/Resources/LinkXml/link.xml.meta similarity index 100% rename from Resources/link.xml.meta rename to Resources/LinkXml/link.xml.meta diff --git a/Samples.meta b/Samples.meta new file mode 100644 index 0000000..dcf9659 --- /dev/null +++ b/Samples.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 380f9d69e60f71e4a9d81128c03223d5 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: From 9692194bfcf37fc9ed9121eddda09ff9cb28c8e2 Mon Sep 17 00:00:00 2001 From: Sercan Altundas Date: Tue, 4 Jul 2023 17:41:37 +0300 Subject: [PATCH 6/7] chore: move it to root and add search folder --- Editor/LinkXmlTransferer.cs | 4 +++- Resources/LinkXml.meta | 8 -------- Resources/{LinkXml => }/link.xml | 0 Resources/{LinkXml => }/link.xml.meta | 0 4 files changed, 3 insertions(+), 9 deletions(-) delete mode 100644 Resources/LinkXml.meta rename Resources/{LinkXml => }/link.xml (100%) rename Resources/{LinkXml => }/link.xml.meta (100%) diff --git a/Editor/LinkXmlTransferer.cs b/Editor/LinkXmlTransferer.cs index 2310ab0..18d94eb 100644 --- a/Editor/LinkXmlTransferer.cs +++ b/Editor/LinkXmlTransferer.cs @@ -8,11 +8,13 @@ namespace OpenAI { public class LinkXmlTransferer : IUnityLinkerProcessor { + private const string SearchFolder = "Packages/com.srcnalt.openai-unity/Resources"; + int IOrderedCallback.callbackOrder => 0; public string GenerateAdditionalLinkXmlFile(BuildReport report, UnityLinkerBuildPipelineData data) { - string[] linkXmlGuid = AssetDatabase.FindAssets("link", new string[] { "Assets/Resources/LinkXml" }); + string[] linkXmlGuid = AssetDatabase.FindAssets("link", new string[] { SearchFolder }); string linkXmlPath = AssetDatabase.GUIDToAssetPath(linkXmlGuid[0]); return Path.GetFullPath(linkXmlPath); } diff --git a/Resources/LinkXml.meta b/Resources/LinkXml.meta deleted file mode 100644 index e73e14c..0000000 --- a/Resources/LinkXml.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 60d29a3b6d57bf640b309d06961657b7 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Resources/LinkXml/link.xml b/Resources/link.xml similarity index 100% rename from Resources/LinkXml/link.xml rename to Resources/link.xml diff --git a/Resources/LinkXml/link.xml.meta b/Resources/link.xml.meta similarity index 100% rename from Resources/LinkXml/link.xml.meta rename to Resources/link.xml.meta From 31101f8f293c911d4c9fba12b755aa967272cd63 Mon Sep 17 00:00:00 2001 From: Sercan Altundas Date: Wed, 5 Jul 2023 00:25:55 +0300 Subject: [PATCH 7/7] Delete Samples.meta --- Samples.meta | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 Samples.meta diff --git a/Samples.meta b/Samples.meta deleted file mode 100644 index dcf9659..0000000 --- a/Samples.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 380f9d69e60f71e4a9d81128c03223d5 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: