diff --git a/WebViewToolkit/CHANGELOG.md b/WebViewToolkit/CHANGELOG.md index 115f717..cfc282b 100644 --- a/WebViewToolkit/CHANGELOG.md +++ b/WebViewToolkit/CHANGELOG.md @@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.3.0] - 2026-01-29 + +### Changed + +- Updated README documentation to reflect current sample structure + - Removed references to outdated BasicWebView and UIToolkit Demo samples + - Added comprehensive descriptions for all six current samples (01-06) + - Organized samples by difficulty level with estimated learning times +- Improved documentation clarity and accuracy + ## [1.2.0] - 2026-01-29 ### Added diff --git a/WebViewToolkit/README.md b/WebViewToolkit/README.md index a8da816..6480381 100644 --- a/WebViewToolkit/README.md +++ b/WebViewToolkit/README.md @@ -1,6 +1,6 @@ # WebView Toolkit for Unity - Package Documentation -**Version 1.0.0** +**Version 1.3.0** Native WebView2 integration for Unity with DirectX 11/12 support. This package provides high-performance, off-screen rendering of modern web content directly to Unity textures. @@ -758,7 +758,7 @@ webView.Navigate(fileUrl); ## Samples -The package includes two comprehensive samples demonstrating different integration approaches. +The package includes six progressive samples that teach you WebViewToolkit from beginner to intermediate level. ### Importing Samples @@ -767,41 +767,89 @@ The package includes two comprehensive samples demonstrating different integrati 3. Expand the **Samples** section 4. Click **Import** next to the desired sample -### BasicWebView Sample +### Learning Path -**Location:** `Samples~/BasicWebView/` +We recommend completing the samples in order for the best learning experience: -Demonstrates basic WebViewBehaviour usage with traditional Unity UI. +#### 01 - Hello WebView +**Difficulty:** Beginner | **Time:** 5 minutes + +Your first WebView! Shows the minimum code needed to display a web page in Unity using UIToolkit. **What you'll learn:** -- Using WebViewBehaviour component -- Basic navigation controls (Go, Back, Forward, Refresh) -- Handling navigation events -- URL input with Enter key support -- Status display +- Creating a WebViewElement in UXML +- Basic scene setup with UIDocument +- Initial URL configuration + +#### 02 - Navigation +**Difficulty:** Beginner | **Time:** 15 minutes -**Key Files:** -- `BasicWebViewSample.cs` - Main sample script -- `BasicWebViewSample.unity` - Demo scene -- `README.md` - Sample-specific instructions +Learn how to navigate between pages, manage history, and respond to navigation events. -### UIToolkit Demo Sample +**What you'll learn:** +- Programmatic navigation with `Navigate()` +- Back/Forward history with `GoBack()`/`GoForward()` +- Checking navigation state with `CanGoBack()`/`CanGoForward()` +- Handling `NavigationCompleted` events +- Enabling/disabling UI based on state -**Location:** `Samples~/UIToolkitDemo/` +#### 03 - JavaScript Bridge +**Difficulty:** Intermediate | **Time:** 30 minutes -Demonstrates WebViewElement and WebViewPanel with UIToolkit. +Master two-way communication between C# and JavaScript. Essential for building interactive web-based UIs. **What you'll learn:** -- Creating WebViewElement programmatically -- Using WebViewPanel for full browser UI -- Dynamic layout with FlexLayout -- UIToolkit event handling -- Address bar and navigation controls +- Calling JavaScript from C# with `ExecuteScript()` +- Receiving messages from JavaScript via `window.chrome.webview.postMessage()` +- JSON serialization for structured data +- Building game UIs that respond to player actions +- Event-driven communication patterns + +#### 04 - Dynamic HTML +**Difficulty:** Intermediate | **Time:** 30 minutes + +Generate web content dynamically from C# data. Perfect for inventory systems, quest logs, and leaderboards. + +**What you'll learn:** +- Loading HTML strings with `NavigateToString()` +- Building HTML programmatically with C# templates +- Real-time content updates +- Creating data-driven UIs (inventory, quest log, settings) +- HTML templating best practices + +#### 05 - Interactive Input +**Difficulty:** Intermediate | **Time:** 20 minutes + +Understand how WebView handles mouse and keyboard input, and how to interact with web forms. + +**What you'll learn:** +- How WebViewElement forwards mouse events automatically +- Understanding normalized [0-1] coordinate system +- Interacting with web forms (inputs, buttons, checkboxes) +- Mouse hover effects and wheel scrolling +- Debugging input coordinate mapping + +#### 06 - Multiple WebViews +**Difficulty:** Intermediate | **Time:** 25 minutes + +Learn to manage multiple WebView instances simultaneously for dashboards or split-screen browsers. + +**What you'll learn:** +- Creating multiple WebViewElements in one scene +- Proper lifecycle management (creation and disposal) +- Independent navigation for each instance +- Performance considerations and optimization +- Memory management best practices + +### Sample Structure + +Each sample includes: +- **Unity Scene** - Ready-to-play demo scene +- **C# Scripts** - Thoroughly commented code +- **UXML/USS Files** - UIToolkit layouts and styles +- **README.md** - Detailed walkthrough and explanations -**Key Files:** -- `WebViewUIToolkitDemo.cs` - Main sample script -- `WebViewUIToolkitDemo.unity` - Demo scene -- `README.md` - Sample-specific instructions +For the complete samples overview and additional learning resources, see `Samples~/README.md` after importing. --- @@ -1163,6 +1211,6 @@ webView.MessageReceived += (msg) => { --- -**Package Version:** 1.0.0 -**Last Updated:** 2026-01-26 +**Package Version:** 1.3.0 +**Last Updated:** 2026-01-29 **License:** MIT diff --git a/WebViewToolkit/package.json b/WebViewToolkit/package.json index b4916bf..36d80c5 100644 --- a/WebViewToolkit/package.json +++ b/WebViewToolkit/package.json @@ -1,6 +1,6 @@ { "name": "com.webviewtoolkit.core", - "version": "1.2.0", + "version": "1.3.0", "displayName": "WebView Toolkit", "description": "Native WebView2 integration for Unity UIToolkit with DirectX 11/12 support. Renders web content to textures for use in Unity UI.", "unity": "2021.3",