webView.SetMargins(10, 10, 10, 10); // Set 10px margins on all sides
// Instantiate the WindayWrapper
WindayWrapper webViewWrapper = new WindayWrapper();
// Subscribe to the OnPageStartLoading event
webViewWrapper.OnPageStartLoading += (url) =>
{
Debug.Log($"Page is starting to load: {url}");
};
// Load a new page
webViewWrapper.LoadPage("https://example.com");
// Subscribe to the OnPageLoaded event
webViewWrapper.OnPageLoaded += (url) =>
{
Debug.Log($"Page has finished loading: {url}");
webViewWrapper.Show();
};
// Load a new page
webViewWrapper.LoadPage("https://example.com");
// Subscribe to the OnClosed event
webViewWrapper.OnСlosed += () =>
{
Debug.Log("WebView has been closed.");
};
// Destroy the WebView
webViewWrapper.Destroy();
webView.Subscribe("exit-mobile-plugin", () => { Debug.Log("Exiting mobile plugin."); });
webView.Subscribe("winday-game-win", () => { Debug.Log("Player has won the game!"); });
webView.Subscribe("winday-game-lose", () => { Debug.Log("Player has lost the game."); });
webView.Subscribe("winday-game-tutorial-start", () => { Debug.Log("Tutorial has started."); });
webView.Subscribe("winday-game-tutorial-complete", () => { Debug.Log("Tutorial is complete."); });
webView.Subscribe<GameColors>("winday-game-colors", (colors) => { Debug.Log($"Colors: Yellow - {colors.yellow}, Blue - {colors.blue}, Red - {colors.red}, Green - {colors.green}, Purple - {colors.purple}"); });