-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Scriptable Object Pattern and Project OverView.
- Loading branch information
1 parent
f163848
commit 9cd1fdb
Showing
12 changed files
with
194 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+17.5 MB
Builds/ScriptableObjectPattern/Build/ScriptableObjectPattern.data.unityweb
Binary file not shown.
Binary file added
BIN
+72.2 KB
Builds/ScriptableObjectPattern/Build/ScriptableObjectPattern.framework.js.unityweb
Binary file not shown.
1 change: 1 addition & 0 deletions
1
Builds/ScriptableObjectPattern/Build/ScriptableObjectPattern.loader.js
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file added
BIN
+7.07 MB
Builds/ScriptableObjectPattern/Build/ScriptableObjectPattern.wasm.unityweb
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
<!DOCTYPE html> | ||
<html lang="en-us"> | ||
|
||
<head> | ||
<meta charset="utf-8"> | ||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | ||
<title>ScriptableObjectPattern</title> | ||
<style> | ||
html, | ||
body { | ||
background: #000; | ||
width: 100%; | ||
height: 100%; | ||
overflow: visible; | ||
padding: 0; | ||
margin: 0; | ||
} | ||
|
||
div#gameContainer { | ||
background: transparent !important; | ||
position: absolute; | ||
} | ||
|
||
div#gameContainer canvas { | ||
position: absolute; | ||
} | ||
|
||
div#gameContainer canvas[data-pixel-art="true"] { | ||
position: absolute; | ||
image-rendering: optimizeSpeed; | ||
image-rendering: -webkit-crisp-edges; | ||
image-rendering: -moz-crisp-edges; | ||
image-rendering: -o-crisp-edges; | ||
image-rendering: crisp-edges; | ||
image-rendering: -webkit-optimize-contrast; | ||
image-rendering: optimize-contrast; | ||
image-rendering: pixelated; | ||
-ms-interpolation-mode: nearest-neighbor; | ||
} | ||
</style> | ||
</head> | ||
|
||
<body> | ||
<div id="gameContainer"> | ||
<canvas id="unity-canvas" data-pixel-art="false"></canvas> | ||
<script src="Build/ScriptableObjectPattern.loader.js"></script> | ||
<script> | ||
var canvas = document.querySelector("#unity-canvas"); | ||
var config = { | ||
dataUrl: "Build/ScriptableObjectPattern.data.unityweb", | ||
frameworkUrl: "Build/ScriptableObjectPattern.framework.js.unityweb", | ||
codeUrl: "Build/ScriptableObjectPattern.wasm.unityweb", | ||
streamingAssetsUrl: "StreamingAssets", | ||
companyName: "SimonNordon", | ||
productName: "ScriptableObjectPattern", | ||
productVersion: "1.0", | ||
}; | ||
var scaleToFit = true; | ||
function progressHandler(progress) { | ||
var percent = progress * 100 + '%'; | ||
canvas.style.background = 'linear-gradient(to right, white, white ' + percent + ', transparent ' + percent + ', transparent) no-repeat center'; | ||
canvas.style.backgroundSize = '100% 1rem'; | ||
} | ||
function onResize() { | ||
var container = canvas.parentElement; | ||
var w; | ||
var h; | ||
|
||
if (scaleToFit) { | ||
w = window.innerWidth; | ||
h = window.innerHeight; | ||
|
||
var r = 600 / 960; | ||
|
||
if (w * r > window.innerHeight) { | ||
w = Math.min(w, Math.ceil(h / r)); | ||
} | ||
h = Math.floor(w * r); | ||
} else { | ||
w = 960; | ||
h = 600; | ||
} | ||
|
||
container.style.width = canvas.style.width = w + "px"; | ||
container.style.height = canvas.style.height = h + "px"; | ||
container.style.top = Math.floor((window.innerHeight - h) / 2) + "px"; | ||
container.style.left = Math.floor((window.innerWidth - w) / 2) + "px"; | ||
} | ||
createUnityInstance(canvas, config, progressHandler).then(function (instance) { | ||
canvas = instance.Module.canvas; | ||
onResize(); | ||
}); | ||
window.addEventListener('resize', onResize); | ||
onResize(); | ||
|
||
if (/iPhone|iPad|iPod|Android/i.test(navigator.userAgent)) { | ||
// Mobile device style: fill the whole browser client area with the game canvas: | ||
const meta = document.createElement('meta'); | ||
meta.name = 'viewport'; | ||
meta.content = 'width=device-width, height=device-height, initial-scale=1.0, user-scalable=no, shrink-to-fit=yes'; | ||
document.getElementsByTagName('head')[0].appendChild(meta); | ||
} | ||
</script> | ||
</div> | ||
</body> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.