Skip to content

Latest commit

 

History

History
95 lines (66 loc) · 2.68 KB

File metadata and controls

95 lines (66 loc) · 2.68 KB
Game Frame X Logo

Game Frame X Web View

License Version Unity Version Documentation

All-in-One Solution for Indie Game Development · Empowering Indie Developers' Dreams


Documentation · Quick Start · QQ Group: 467608841 / 233840761


English | 简体中文 | 繁體中文 | 日本語 | 한국어

Project Overview

Game Frame X Web View is a Web View component for the Game Frame X game framework. It allows you to embed and display web content within Unity games.

This component wraps gree/unity-webview, providing a simpler API and easier integration.

Features

  • Display web pages within Unity games
  • Interact between C# and JavaScript
  • Fullscreen support
  • Android and iOS platform support

Installation

Installation

Edit your Unity project's Packages/manifest.json and add the scopedRegistries section:

{
  "scopedRegistries": [
    {
      "name": "GameFrameX",
      "url": "https://gameframex.upm.alianblank.uk",
      "scopes": [
        "com.gameframex"
      ]
    }
  ]
}

scopes controls which packages are resolved through this registry. Only packages whose names start with com.gameframex will be fetched from it.

Then add the package to dependencies:

{
  "dependencies": {
    "com.gameframex.unity.webview": "1.0.0"
  }
}

Usage

using GameFrameX.WebView.Runtime;
using UnityEngine;

public class Example : MonoBehaviour
{
    void Start()
    {
        var webView = FindObjectOfType<WebViewComponent>();
        webView.Show("https://gameframex.doc.alianblank.com");
    }
}

API

  • Show(string url) - Display a web view and load the specified URL
  • Hide() - Hide the web view
  • MakeFullScreen() - Set the web view to fullscreen
  • ExecuteJavaScript(string javaScript) - Execute JavaScript code

License

This repository is licensed under the MIT License.