Call Unity WebGL Functions From Javascript

Опубликовано: 25 Февраль 2026
на канале: Class Outside
658
3

Downloads:
NodeJS / NPM Download: https://nodejs.org/en/download/
VSCode: https://code.visualstudio.com/download
Unity downloads Archive: https://unity.com/releases/editor/arc...
OpenSSL Download: https://slproweb.com/products/Win32Op...
3D Model: https://www.fab.com/listings/49ab6ff2...

Demonstration Project:
Github Project: https://github.com/ClassOutside/Unity...

Related Videos:
WebXR Demo Setup:    • Unity WebXR Setup  
Setup local server:    • Set Up a Local Server and Connect From You...  
https on lan:    • Setting Up HTTPS For Local Networks (LAN) ...  

Scripts:
com.unity.cloud.gltfast
OpenSSL Commands: openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout key.pem -out cert.pem
npm install
npm run dev
Get IP Address: for /f "tokens=14" %a in ('ipconfig ^| findstr /R "IPv4"') do @echo %a


Documentation:
Unity Shader preloading for GLTFast: https://docs.unity3d.com/Packages/com...
GLTFast Unity Documentation: https://docs.unity3d.com/Packages/com...

If this was helpful, consider leaving a comment or supporting me on Ko-fi: https://ko-fi.com/classoutside

===== TIMESTAMPS =====

0:00 Introduction and requirements
0:51 Creating a new Unity project and setting up UI
2:19 Importing scripts and resolving GLTFast package errors
2:58 Reviewing the SpawnManager script and async model loading
3:54 Setting up backend server and HTTPS certificates
5:04 Running backend server and finding local IP address
5:39 Adding script to Unity objects and configuring button
6:29 Downloading and adding 3D model to backend
6:55 Overview of backend server file handling GLB requests
7:23 Testing model loading in Unity and adjusting scale
7:53 Fixing shader issues and preloading shaders in Unity
9:13 Final test and conclusion