Commit 2d342dfe authored by Sebastian Höffner's avatar Sebastian Höffner
Browse files

Storing custom index.html to serve a proper handler and function as examples for later reference.

parent 8387baf1
<!DOCTYPE html>
<html lang="en-us">
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Unity WebGL Player | DLU Physics Simulator</title>
<link rel="shortcut icon" href="TemplateData/favicon.ico">
<link rel="stylesheet" href="TemplateData/style.css">
window.DLUHandler = function(message) {
console.log("DLUHandler called!")
document.getElementById("response").innerHTML = JSON.stringify(message);
request = function(message) {
// e.g. {'Command': 'GET_CONTEXT'}
unityInstance.SendMessage("DLU/CommunicationChannels", "PerformRequest", JSON.stringify(message));
<script src="TemplateData/UnityProgress.js"></script>
<script src="Build/UnityLoader.js"></script>
var unityInstance = UnityLoader.instantiate("unityContainer", "Build/PhysicsSimulator.json", {onProgress: UnityProgress});
<div class="webgl-content">
<div id="unityContainer" style="width: 960px; height: 600px"></div>
<div class="footer">
<div class="webgl-logo"></div>
<div class="fullscreen" onclick="unityInstance.SetFullscreen(1)"></div>
<div class="title">DLU Physics Simulator</div>
<div id="response"></div>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment