From 2ee8be827b169fa3e171b7a4e829627a1519c846 Mon Sep 17 00:00:00 2001 From: h0lybyte <5599058+h0lybyte@users.noreply.github.com> Date: Mon, 18 Nov 2024 13:50:34 -0500 Subject: [PATCH] fix(kilonet): adding a reference to the cysharp threading. --- apps/kbve.com/src/content/journal/11-18.mdx | 9 ++++++++- packages/kilonet/Kbve.Kilonet.asmdef | 5 +++-- packages/kilonet/kilonet/Utils/VuplexHelper.cs | 4 +--- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/apps/kbve.com/src/content/journal/11-18.mdx b/apps/kbve.com/src/content/journal/11-18.mdx index 4705566d2..68a77522d 100644 --- a/apps/kbve.com/src/content/journal/11-18.mdx +++ b/apps/kbve.com/src/content/journal/11-18.mdx @@ -19,4 +19,11 @@ import { Adsense, Tasks } from '@kbve/astropad'; **WebGL** Adjusted the WebGL build, going to push up another commit as well. - We do need to adjust the supabase login, making sure that it works for both Standalone and WebGL. \ No newline at end of file + We do need to adjust the supabase login, making sure that it works for both Standalone and WebGL. + +- 12:50PM + + **Vuplex** + + The `Vuplex` provider provides a way to utilize the webview but we want to focus on making it work through our package. + However it seems that it crashes on the macbook, so I am going to try to make it work on the windows desktop. \ No newline at end of file diff --git a/packages/kilonet/Kbve.Kilonet.asmdef b/packages/kilonet/Kbve.Kilonet.asmdef index 6b04f1eca..1c9f13882 100644 --- a/packages/kilonet/Kbve.Kilonet.asmdef +++ b/packages/kilonet/Kbve.Kilonet.asmdef @@ -2,13 +2,14 @@ "name": "Kbve.Kilonet", "rootNamespace": "KBVE.Kilonet", "references": [ - "Vuplex.WebView", + "Vuplex.WebView", "Supabase.Core", "Supabase.Functions", "Supabase.Gotrue", "Supabase.Postgrest", "Supabase.Realtime", - "Supabase.Storage" + "Supabase.Storage", + "Cysharp.Threading.Tasks" ], "includePlatforms": [], "excludePlatforms": [], diff --git a/packages/kilonet/kilonet/Utils/VuplexHelper.cs b/packages/kilonet/kilonet/Utils/VuplexHelper.cs index cbfcec709..09fb52f85 100644 --- a/packages/kilonet/kilonet/Utils/VuplexHelper.cs +++ b/packages/kilonet/kilonet/Utils/VuplexHelper.cs @@ -12,6 +12,7 @@ namespace KBVE.Kilonet.Utils { public class VuplexHelper : MonoBehaviour { + public Canvas CanvasObject; public CanvasWebViewPrefab CanvasWebViewPrefab; public IWebView CanvasWebViewPrefabView; @@ -46,15 +47,12 @@ private async UniTask InitializeWebView() return; } - // Initialize the CanvasWebViewPrefab await CanvasWebViewPrefab.WaitUntilInitialized(); - // Dynamically assign the WebView to CanvasWebViewPrefabView if (CanvasWebViewPrefab.WebView != null) { CanvasWebViewPrefabView = CanvasWebViewPrefab.WebView; - // Subscribe to the WebView's MessageEmitted event CanvasWebViewPrefabView.MessageEmitted += OnMessageReceived; Debug.Log("Vuplex WebView successfully initialized and ready to receive messages.");