Browse Source

Webgl works alongside android + included in project

master
Joshua Reason 5 years ago
parent
commit
3e1b9c674e
60 changed files with 517 additions and 50 deletions
  1. +1
    -0
      .gitattributes
  2. +3
    -0
      .gitignore
  3. +2
    -2
      Assets/Data/Networking/Server/Realtime/Server.asset
  4. +20
    -0
      Assets/Plugins/GetURL.jslib
  5. +36
    -0
      Assets/Plugins/GetURL.jslib.meta
  6. +0
    -8
      Assets/Plugins/IngameDebugConsole/Sprites/Unused.meta
  7. +13
    -0
      Assets/Plugins/wegGLKeyboard.jslib
  8. +36
    -0
      Assets/Plugins/wegGLKeyboard.jslib.meta
  9. +1
    -1
      Assets/Prefabs/Map Sections/Width 3.meta
  10. +7
    -5
      Assets/Scripts/Browser/BrowserServer.cs
  11. +51
    -0
      Assets/Scripts/Browser/WebGLKeyboard.cs
  12. +11
    -0
      Assets/Scripts/Browser/WebGLKeyboard.cs.meta
  13. +1
    -1
      Assets/Scripts/Components.meta
  14. +0
    -8
      Assets/Scripts/LogicBlocks.meta
  15. +4
    -4
      Assets/Scripts/Managers/GameManager.cs
  16. +5
    -0
      Assets/Scripts/Networking/Core/Utility/ExtensionMethods.cs
  17. +13
    -8
      Assets/Scripts/Networking/Server/ClientList.cs
  18. +1
    -1
      Assets/Scripts/Networking/Server/NetworkedClient.cs
  19. +1
    -1
      Assets/Scripts/Networking/Server/ServerManager.cs
  20. +53
    -5
      Assets/Scripts/Networking/Server/ServerObject.cs
  21. +2
    -2
      Assets/Scripts/UI/Lobby/LobbyUIController.cs
  22. +1
    -1
      Assets/StreamingAssets.meta
  23. +1
    -1
      Assets/StreamingAssets/WebGLBuild.meta
  24. +8
    -0
      Assets/StreamingAssets/WebGLBuild/Build.meta
  25. +4
    -0
      Assets/StreamingAssets/WebGLBuild/Build/UnityLoader.js
  26. +7
    -0
      Assets/StreamingAssets/WebGLBuild/Build/UnityLoader.js.meta
  27. +3
    -0
      Assets/StreamingAssets/WebGLBuild/Build/WebGLBuild.data.unityweb
  28. +7
    -0
      Assets/StreamingAssets/WebGLBuild/Build/WebGLBuild.data.unityweb.meta
  29. +13
    -0
      Assets/StreamingAssets/WebGLBuild/Build/WebGLBuild.json
  30. +7
    -0
      Assets/StreamingAssets/WebGLBuild/Build/WebGLBuild.json.meta
  31. +3
    -0
      Assets/StreamingAssets/WebGLBuild/Build/WebGLBuild.wasm.code.unityweb
  32. +7
    -0
      Assets/StreamingAssets/WebGLBuild/Build/WebGLBuild.wasm.code.unityweb.meta
  33. +3
    -0
      Assets/StreamingAssets/WebGLBuild/Build/WebGLBuild.wasm.framework.unityweb
  34. +7
    -0
      Assets/StreamingAssets/WebGLBuild/Build/WebGLBuild.wasm.framework.unityweb.meta
  35. +8
    -0
      Assets/StreamingAssets/WebGLBuild/TemplateData.meta
  36. +24
    -0
      Assets/StreamingAssets/WebGLBuild/TemplateData/UnityProgress.js
  37. +7
    -0
      Assets/StreamingAssets/WebGLBuild/TemplateData/UnityProgress.js.meta
  38. BIN
      Assets/StreamingAssets/WebGLBuild/TemplateData/favicon.ico
  39. +7
    -0
      Assets/StreamingAssets/WebGLBuild/TemplateData/favicon.ico.meta
  40. +3
    -0
      Assets/StreamingAssets/WebGLBuild/TemplateData/fullscreen.png
  41. +7
    -0
      Assets/StreamingAssets/WebGLBuild/TemplateData/fullscreen.png.meta
  42. +3
    -0
      Assets/StreamingAssets/WebGLBuild/TemplateData/progressEmpty.Dark.png
  43. +7
    -0
      Assets/StreamingAssets/WebGLBuild/TemplateData/progressEmpty.Dark.png.meta
  44. +3
    -0
      Assets/StreamingAssets/WebGLBuild/TemplateData/progressEmpty.Light.png
  45. +7
    -0
      Assets/StreamingAssets/WebGLBuild/TemplateData/progressEmpty.Light.png.meta
  46. +3
    -0
      Assets/StreamingAssets/WebGLBuild/TemplateData/progressFull.Dark.png
  47. +7
    -0
      Assets/StreamingAssets/WebGLBuild/TemplateData/progressFull.Dark.png.meta
  48. +3
    -0
      Assets/StreamingAssets/WebGLBuild/TemplateData/progressFull.Light.png
  49. +7
    -0
      Assets/StreamingAssets/WebGLBuild/TemplateData/progressFull.Light.png.meta
  50. +3
    -0
      Assets/StreamingAssets/WebGLBuild/TemplateData/progressLogo.Dark.png
  51. +7
    -0
      Assets/StreamingAssets/WebGLBuild/TemplateData/progressLogo.Dark.png.meta
  52. +3
    -0
      Assets/StreamingAssets/WebGLBuild/TemplateData/progressLogo.Light.png
  53. +7
    -0
      Assets/StreamingAssets/WebGLBuild/TemplateData/progressLogo.Light.png.meta
  54. +18
    -0
      Assets/StreamingAssets/WebGLBuild/TemplateData/style.css
  55. +7
    -0
      Assets/StreamingAssets/WebGLBuild/TemplateData/style.css.meta
  56. +3
    -0
      Assets/StreamingAssets/WebGLBuild/TemplateData/webgl-logo.png
  57. +7
    -0
      Assets/StreamingAssets/WebGLBuild/TemplateData/webgl-logo.png.meta
  58. +25
    -0
      Assets/StreamingAssets/WebGLBuild/index.html
  59. +7
    -0
      Assets/StreamingAssets/WebGLBuild/index.html.meta
  60. +2
    -2
      ProjectSettings/GraphicsSettings.asset

+ 1
- 0
.gitattributes View File

@ -37,3 +37,4 @@
*.zip filter=lfs diff=lfs merge=lfs -text
*.asset filter=lfs diff=lfs merge=lfs -text
*.unity filter=lfs diff=lfs merge=lfs -text
*.unityweb filter=lfs diff=lfs merge=lfs -text

+ 3
- 0
.gitignore View File

@ -9,6 +9,9 @@
[Bb]uilds/
Assets/AssetStoreTools*
#Include all of Streaming Assets
!Assets/StreamingAssets/**
#Large WIP or legacy files
(Legacy)/
.WIP Textures/

+ 2
- 2
Assets/Data/Networking/Server/Realtime/Server.asset View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:6d7b72510c56d1d1adc4dc2473034b884e8b831978ca1efc7ad50b536157b696
size 508
oid sha256:bb2f97ea3a07f0b8f8e7cb0dff6e4bfef283dc0c83b8ec9d9cc81d77319661cc
size 527

+ 20
- 0
Assets/Plugins/GetURL.jslib View File

@ -0,0 +1,20 @@
mergeInto(LibraryManager.library, {
GetURLFromPage: function () {
var returnStr = window.top.location.href;
var bufferSize = lengthBytesUTF8(returnStr) + 1
var buffer = _malloc(bufferSize);
stringToUTF8(returnStr, buffer, bufferSize);
return buffer;
},
GetQueryParam: function(paramId) {
var urlParams = new URLSearchParams(location.search);
var param = urlParams.get(Pointer_stringify(paramId));
console.log("JavaScript read param: " + param);
var bufferSize = lengthBytesUTF8(param) + 1;
var buffer = _malloc(bufferSize);
stringToUTF8(param, buffer, bufferSize);
return buffer;
}
});

+ 36
- 0
Assets/Plugins/GetURL.jslib.meta View File

@ -0,0 +1,36 @@
fileFormatVersion: 2
guid: c24c76f5a4dd09e438c024cb8078f81a
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
platformData:
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
- first:
Facebook: WebGL
second:
enabled: 1
settings: {}
- first:
WebGL: WebGL
second:
enabled: 1
settings: {}
userData:
assetBundleName:
assetBundleVariant:

+ 0
- 8
Assets/Plugins/IngameDebugConsole/Sprites/Unused.meta View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: f6caae32d463529478f2186f47c2e3fe
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

+ 13
- 0
Assets/Plugins/wegGLKeyboard.jslib View File

@ -0,0 +1,13 @@
mergeInto(LibraryManager.library, {
focusHandleAction: function(_name, _str){
if(UnityLoader.SystemInfo.mobile == true){
var _inputTextData = prompt("", Pointer_stringify(_str));
if (_inputTextData == null || _inputTextData == "") {
//canceled text
} else {
//send data to unity
SendMessage(Pointer_stringify(_name), 'ReceiveInputData', _inputTextData);
}
}
},
});

+ 36
- 0
Assets/Plugins/wegGLKeyboard.jslib.meta View File

@ -0,0 +1,36 @@
fileFormatVersion: 2
guid: 9a2f32da2f4130346bc1f7e0b221f5c3
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
platformData:
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
- first:
Facebook: WebGL
second:
enabled: 1
settings: {}
- first:
WebGL: WebGL
second:
enabled: 1
settings: {}
userData:
assetBundleName:
assetBundleVariant:

Assets/Models.meta → Assets/Prefabs/Map Sections/Width 3.meta View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 296bd90e667df1f4697823a0aa45acf0
guid: be25a323ad5fce04d9ff37db05f30f0c
folderAsset: yes
DefaultImporter:
externalObjects: {}

+ 7
- 5
Assets/Scripts/Browser/BrowserServer.cs View File

@ -10,17 +10,19 @@ public class BrowserServer : MonoBehaviour
{
[SerializeField]
private string HTMLPath;
[Tooltip("Local Path in Streaming Assets")]
private string LocalPath;
[SerializeField]
private int port;
[Tooltip("Browsers by default use 80")]
private int port = 80;
SimpleHTTPServer server;
// Start is called before the first frame update
void Start()
{
server = new SimpleHTTPServer(HTMLPath, port);
server = new SimpleHTTPServer(Path.Combine(Application.streamingAssetsPath,LocalPath),port);
}
private void OnDisable()
@ -55,7 +57,7 @@ public class BrowserServer : MonoBehaviour
HttpListenerResponse response = context.Response;
string page = HTMLPath + context.Request.Url.LocalPath;
string page = Path.Combine(Application.streamingAssetsPath, LocalPath, context.Request.Url.LocalPath);
Debug.Log("Client asked for: " + context.Request.Url.LocalPath);
if (page.EndsWith("/"))
page += "index.html";
@ -95,7 +97,7 @@ public class BrowserServer : MonoBehaviour
string responseString = "<html><body><h1>Error Connecting to server</h1></body></html>";
try
{
responseString = System.IO.File.ReadAllText(HTMLPath);
responseString = System.IO.File.ReadAllText(Path.Combine(Application.streamingAssetsPath, LocalPath, context.Request.Url.LocalPath));
Debug.Log(responseString);
}
catch (System.IO.IOException e)

+ 51
- 0
Assets/Scripts/Browser/WebGLKeyboard.cs View File

@ -0,0 +1,51 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.EventSystems;
using System.Runtime.InteropServices;
using System;
public class WebGLKeyboard : MonoBehaviour, ISelectHandler
{
[DllImport("__Internal")]
private static extern void focusHandleAction(string _name, string _str);
private InputField UnityInput;
private TMPro.TMP_InputField TMPInput;
private void Awake()
{
UnityInput = GetComponent<InputField>();
TMPInput = GetComponent<TMPro.TMP_InputField>();
}
public void ReceiveInputData(string value)
{
if (TMPInput != null)
TMPInput.text = value;
else if (UnityInput != null)
UnityInput.text = value;
}
public void OnSelect(BaseEventData data)
{
#if UNITY_WEBGL
try
{
if (TMPInput != null)
focusHandleAction(gameObject.name, TMPInput.text);
else if (UnityInput != null)
focusHandleAction(gameObject.name, UnityInput.text);
}
catch (Exception error) { }
#endif
}
}

+ 11
- 0
Assets/Scripts/Browser/WebGLKeyboard.cs.meta View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 516583a80931657498c305160bf48997
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

Assets/Plugins/IngameDebugConsole/Android.meta → Assets/Scripts/Components.meta View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 3d7d7a61a5341904eb3c65af025b1d86
guid: 8d7394d70ec233849a60a26da5f23b75
folderAsset: yes
DefaultImporter:
externalObjects: {}

+ 0
- 8
Assets/Scripts/LogicBlocks.meta View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 8936b441d7647f74884c94f97bfb8931
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

+ 4
- 4
Assets/Scripts/Managers/GameManager.cs View File

@ -321,7 +321,7 @@ public class GameManager : MonoBehaviour
/// </summary>
private void RegisterHandlers()
{
server.server.RegisterHandler(LogicProtocols.SendLogicList, RecieveLogicList);
server.RegisterHandler(LogicProtocols.SendLogicList, RecieveLogicList);
}
/// <summary>
@ -329,7 +329,7 @@ public class GameManager : MonoBehaviour
/// </summary>
private void UnRegisterHandlers()
{
server.server.UnregisterHandler(LogicProtocols.SendLogicList);
server.UnregisterHandler(LogicProtocols.SendLogicList);
}
/// <summary>
@ -348,8 +348,8 @@ public class GameManager : MonoBehaviour
////Debug.Log("Recieved function from " + ClientList[msg.conn.connectionId].Name);
//Update player Data with recieved list
playerData[msg.conn.connectionId].blockReader.LogicChain = new List<LogicBlock>(logicMsg.elements);
playerData[msg.conn.connectionId].recievedList = true;
playerData[msg.conn.Hash()].blockReader.LogicChain = new List<LogicBlock>(logicMsg.elements);
playerData[msg.conn.Hash()].recievedList = true;
}
#endregion Networking Functions

+ 5
- 0
Assets/Scripts/Networking/Core/Utility/ExtensionMethods.cs View File

@ -33,6 +33,11 @@ namespace Networking
return null;
}
public static int Hash(this NetworkConnection conn)
{
return (conn.address.GetHashCode() + conn.connectionId).GetHashCode();
}
}
}

+ 13
- 8
Assets/Scripts/Networking/Server/ClientList.cs View File

@ -46,7 +46,7 @@ namespace Networking.Server
#endregion Public Variables
#region Private Variables
public NetworkServerSimple server;
public ServerObject server;
#endregion Private Variables
@ -66,7 +66,7 @@ namespace Networking.Server
/// <param name="serverObject">Server to register handlers with</param>
public void SetUp(ServerObject serverObject)
{
this.server = serverObject.server;
this.server = serverObject;
Reset();
server.RegisterHandler(MsgType.Connect, OnClientConnect);
server.RegisterHandler(MsgType.Disconnect, OnClientDisconnect);
@ -75,6 +75,9 @@ namespace Networking.Server
public void OnClientConnect(NetworkMessage msg)
{
Debug.Log("newClient: " + msg.conn.address + ", " + msg.conn.Hash() + ", " + msg.conn.hostId);
if (ConnectedClients.Any(p => p.ID == msg.channelId))
{
Debug.LogError("Client[" + msg.channelId + "] already connected");
@ -93,13 +96,13 @@ namespace Networking.Server
{
PotentialClients.RemoveAll(p => p == msg.conn);
if (!ConnectedClients.Any(p => p.ID == msg.conn.connectionId))
if (!ConnectedClients.Any(p => p.ID == msg.conn.Hash()))
{
Debug.LogError("Unknown client disconnect [" + msg.conn.connectionId + "]");
Debug.LogError("Unknown client disconnect [" + msg.conn.Hash() + "]");
return;
}
ClientData client = ConnectedClients.FirstOrDefault(p => p.ID == msg.conn.connectionId);
ClientData client = ConnectedClients.FirstOrDefault(p => p.ID == msg.conn.Hash());
ConnectedClients.Remove(client);
DisconnectedClients.Add(client);
@ -119,14 +122,16 @@ namespace Networking.Server
return;
}
if (ConnectedClients.Any(p => p.ID == msg.channelId))
if (ConnectedClients.Any(p => p.ID == msg.conn.Hash()))
{
Debug.LogError("Client[" + msg.channelId + "] already connected");
msg.conn.Send(LoginProtocols.LoginFail, new LoginProtocols.EmptyMsg());
return;
}
ClientData newClient = DisconnectedClients.FirstOrDefault(p => p.ID == msg.conn.connectionId);
ClientData newClient = DisconnectedClients.FirstOrDefault(p => p.ID == msg.conn.Hash());
if (newClient != default)
{
Debug.Log("Reconnection: " + loginMsg.Name + ((loginMsg.Name != newClient.Name) ? (" (Prev. " + newClient.Name +")") : ""));
@ -214,7 +219,7 @@ namespace Networking.Server
/// <summary>
/// Network connection ID
/// </summary>
public int ID { get { return (conn != null) ? conn.connectionId : -1; }}
public int ID { get { return (conn != null) ? conn.Hash() : -1; }}
/// <summary>
/// Connection to Client

+ 1
- 1
Assets/Scripts/Networking/Server/NetworkedClient.cs View File

@ -17,7 +17,7 @@ public class NetworkedClient : MonoBehaviour
void Start()
{
Debug.Log("Registering: " + LogicProtocols.SendLogicList);
server.server.RegisterHandler(LogicProtocols.SendLogicList, RecieveLogicList);
server.RegisterHandler(LogicProtocols.SendLogicList, RecieveLogicList);
}
public void RecieveLogicList(NetworkMessage msg)

+ 1
- 1
Assets/Scripts/Networking/Server/ServerManager.cs View File

@ -28,7 +28,7 @@ namespace Networking.Server
{
if (StartServerOnAwake)
{
Server.StartServer(Port);
Server.StartServer();
}
}

+ 53
- 5
Assets/Scripts/Networking/Server/ServerObject.cs View File

@ -16,44 +16,92 @@ namespace Networking.Server {
[SerializeField]
private int Port;
[SerializeField]
private bool useWebSockets;
[SerializeField]
private int webPort;
[Header("References")]
[SerializeField]
private ClientList LoginHandler;
public bool useWebSockets;
#endregion Inspector Fields
#region ReadOnly Variables
public NetworkServerSimple server { get; private set;}
private NetworkServerSimple webServer;
#endregion ReadOnly Variables
public void StartServer(int port)
public void StartServer()
{
LoginHandler.ConnectedClients = new List<ClientData>();
LoginHandler.DisconnectedClients = new List<ClientData>();
//Debug.Log("Starting Server on " + port);
server = new NetworkServerSimple();
server.useWebSockets = useWebSockets;
server.Configure(TransportConfigure.CreateConfigure(),32);
if (useWebSockets)
{
webServer = new NetworkServerSimple();
webServer.useWebSockets = true;
webServer.Configure(TransportConfigure.CreateConfigure(), 32);
}
LoginHandler.SetUp(this);
server.Listen(port);
server.Listen(Port);
webServer.Listen(webPort);
}
public void ServerClose()
{
if (server != null)
server.Stop();
if (webServer != null)
webServer.Stop();
}
public void ServerUpdate()
{
if (server != null)
server.Update();
if (webServer != null)
webServer.Update();
}
public void RegisterHandler(short msgType,NetworkMessageDelegate handler)
{
if (server != null)
server.RegisterHandler(msgType, handler);
if (webServer != null)
webServer.RegisterHandler(msgType, handler);
}
public void UnregisterHandler(short msgType)
{
if (server != null)
server.UnregisterHandler(msgType);
if (webServer != null)
webServer.UnregisterHandler(msgType);
}
public void DisconnectAllConnections()
{
if (server != null)
server.DisconnectAllConnections();
if (webServer != null)
webServer.DisconnectAllConnections();
}
}
}

+ 2
- 2
Assets/Scripts/UI/Lobby/LobbyUIController.cs View File

@ -38,7 +38,7 @@ public class LobbyUIController : MonoBehaviour
DisplayClients(Clients.ConnectedClients);
if (Server.server != null)
Server.server.RegisterHandler(LoginProtocols.StartGame, RecieveStartMsg);
Server.RegisterHandler(LoginProtocols.StartGame, RecieveStartMsg);
else
Debug.LogWarning("Server not started yet");
}
@ -48,7 +48,7 @@ public class LobbyUIController : MonoBehaviour
Clients.OnClientsChange -= DisplayClients;
if (Server.server != null)
Server.server.UnregisterHandler(LoginProtocols.StartGame);
Server.UnregisterHandler(LoginProtocols.StartGame);
}
private void DisplayClients(List<ClientData> data)

Assets/Plugins/IngameDebugConsole/Prefabs.meta → Assets/StreamingAssets.meta View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 7dbc36665bc0d684db9a4447e27a7a4b
guid: d14f9a69828e04f409637bb2e92a0185
folderAsset: yes
DefaultImporter:
externalObjects: {}

Assets/Plugins/IngameDebugConsole/Scripts.meta → Assets/StreamingAssets/WebGLBuild.meta View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 860c08388401a6d4e858fe4910ea9337
guid: d24495022ea62b74dbe9a344a7b25e9b
folderAsset: yes
DefaultImporter:
externalObjects: {}

+ 8
- 0
Assets/StreamingAssets/WebGLBuild/Build.meta View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 2e554f8cda74fad42ad122eda682d0f5
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

+ 4
- 0
Assets/StreamingAssets/WebGLBuild/Build/UnityLoader.js
File diff suppressed because it is too large
View File


+ 7
- 0
Assets/StreamingAssets/WebGLBuild/Build/UnityLoader.js.meta View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: b6b0927c5ed2795479fa9fae16cfd9b2
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

+ 3
- 0
Assets/StreamingAssets/WebGLBuild/Build/WebGLBuild.data.unityweb View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:d3b63b387237263b0d53dd2426329f9badf2795062af614a355597e3a2b0c2c6
size 12036029

+ 7
- 0
Assets/StreamingAssets/WebGLBuild/Build/WebGLBuild.data.unityweb.meta View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: a1e435c2e0133c54a90809ecd4fda57d
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

+ 13
- 0
Assets/StreamingAssets/WebGLBuild/Build/WebGLBuild.json View File

@ -0,0 +1,13 @@
{
"companyName": "Pet.Move()",
"productName": "Pet.Move()",
"dataUrl": "WebGLBuild.data.unityweb",
"wasmCodeUrl": "WebGLBuild.wasm.code.unityweb",
"wasmFrameworkUrl": "WebGLBuild.wasm.framework.unityweb",
"TOTAL_MEMORY": 268435456,
"graphicsAPI": ["WebGL 2.0", "WebGL 1.0"],
"webglContextAttributes": {"preserveDrawingBuffer": false},
"splashScreenStyle": "Dark",
"backgroundColor": "#231F20",
"cacheControl": {"default": "must-revalidate"}
}

+ 7
- 0
Assets/StreamingAssets/WebGLBuild/Build/WebGLBuild.json.meta View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 0307e02e88c2e9f419102b2a47ab68fd
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

+ 3
- 0
Assets/StreamingAssets/WebGLBuild/Build/WebGLBuild.wasm.code.unityweb View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:187c75f0c272a04e9ee92922facff177067b3d4829c6653d1896ebf8f7dd06ab
size 5553639

+ 7
- 0
Assets/StreamingAssets/WebGLBuild/Build/WebGLBuild.wasm.code.unityweb.meta View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: d828ba042fc9b1d489098c25b45fd97f
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

+ 3
- 0
Assets/StreamingAssets/WebGLBuild/Build/WebGLBuild.wasm.framework.unityweb View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:b7d98daddd07e869e7e35bd082d9725f075c437c5c9459f5535c8dc50cb435c3
size 96936

+ 7
- 0
Assets/StreamingAssets/WebGLBuild/Build/WebGLBuild.wasm.framework.unityweb.meta View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: b0133bc1be9a52845a3131437ae51617
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

+ 8
- 0
Assets/StreamingAssets/WebGLBuild/TemplateData.meta View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 790fb43fb508dca45a68bb9f7768faf0
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

+ 24
- 0
Assets/StreamingAssets/WebGLBuild/TemplateData/UnityProgress.js View File

@ -0,0 +1,24 @@
function UnityProgress(gameInstance, progress) {
if (!gameInstance.Module)
return;
if (!gameInstance.logo) {
gameInstance.logo = document.createElement("div");
gameInstance.logo.className = "logo " + gameInstance.Module.splashScreenStyle;
gameInstance.container.appendChild(gameInstance.logo);
}
if (!gameInstance.progress) {
gameInstance.progress = document.createElement("div");
gameInstance.progress.className = "progress " + gameInstance.Module.splashScreenStyle;
gameInstance.progress.empty = document.createElement("div");
gameInstance.progress.empty.className = "empty";
gameInstance.progress.appendChild(gameInstance.progress.empty);
gameInstance.progress.full = document.createElement("div");
gameInstance.progress.full.className = "full";
gameInstance.progress.appendChild(gameInstance.progress.full);
gameInstance.container.appendChild(gameInstance.progress);
}
gameInstance.progress.full.style.width = (100 * progress) + "%";
gameInstance.progress.empty.style.width = (100 * (1 - progress)) + "%";
if (progress == 1)
gameInstance.logo.style.display = gameInstance.progress.style.display = "none";
}

+ 7
- 0
Assets/StreamingAssets/WebGLBuild/TemplateData/UnityProgress.js.meta View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: e8ed02e3265846244841b5e2db276f6a
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

BIN
Assets/StreamingAssets/WebGLBuild/TemplateData/favicon.ico View File

Before After

+ 7
- 0
Assets/StreamingAssets/WebGLBuild/TemplateData/favicon.ico.meta View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: adfc8ef557fa74f4983b9b1c3cf214fb
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

+ 3
- 0
Assets/StreamingAssets/WebGLBuild/TemplateData/fullscreen.png View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:922b2a609219c96962e2e7af9d27c1f1935881de617c9d5cb08fdb0d034cafdc
size 345

+ 7
- 0
Assets/StreamingAssets/WebGLBuild/TemplateData/fullscreen.png.meta View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: b4aea228be545f442a667212c8470978
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

+ 3
- 0
Assets/StreamingAssets/WebGLBuild/TemplateData/progressEmpty.Dark.png View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:3c901e72986f57b3dd474c5b8db981da26ec1d9ad92af9edc722172678c07d44
size 155

+ 7
- 0
Assets/StreamingAssets/WebGLBuild/TemplateData/progressEmpty.Dark.png.meta View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 097dca61fdf8a8c4980689e916f49ea0
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

+ 3
- 0
Assets/StreamingAssets/WebGLBuild/TemplateData/progressEmpty.Light.png View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:efbfdb9313bdc0489d96339cf4352c1a80bc953050cf9a6c06a7ced0c0f1a4e2
size 159

+ 7
- 0
Assets/StreamingAssets/WebGLBuild/TemplateData/progressEmpty.Light.png.meta View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 8fca73a2805c57f48860bc10890d635a
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

+ 3
- 0
Assets/StreamingAssets/WebGLBuild/TemplateData/progressFull.Dark.png View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:2832fafec86b420ee29e0e2126b95767a22bff85d30dc90ed8de36246b395fd8
size 137

+ 7
- 0
Assets/StreamingAssets/WebGLBuild/TemplateData/progressFull.Dark.png.meta View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 9ed6abc2da6677e40af5767300029d5e
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

+ 3
- 0
Assets/StreamingAssets/WebGLBuild/TemplateData/progressFull.Light.png View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:706765aced698c9790bb31eafd12b8161fadc46a62214926788a7a84cdc5fb51
size 142

+ 7
- 0
Assets/StreamingAssets/WebGLBuild/TemplateData/progressFull.Light.png.meta View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: ea3a2642d139efb4a9c9819082691256
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

+ 3
- 0
Assets/StreamingAssets/WebGLBuild/TemplateData/progressLogo.Dark.png View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:b95da4db2adc10af8bee6bfccb5246cc356b3164ce7caf6c7581c1002d64b71b
size 2343

+ 7
- 0
Assets/StreamingAssets/WebGLBuild/TemplateData/progressLogo.Dark.png.meta View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 96ce4826f21e7014aaf11a5cabe333cc
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

+ 3
- 0
Assets/StreamingAssets/WebGLBuild/TemplateData/progressLogo.Light.png View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:270d4f3c53ec8acbef1657520116e9bbd5efe074e4fc12db05fdb9a745ae96bb
size 2259

+ 7
- 0
Assets/StreamingAssets/WebGLBuild/TemplateData/progressLogo.Light.png.meta View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 1e626ea48d428a543a10e9d1646df574
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

+ 18
- 0
Assets/StreamingAssets/WebGLBuild/TemplateData/style.css View File

@ -0,0 +1,18 @@
.webgl-content * {border: 0; margin: 0; padding: 0}
.webgl-content {position: absolute; top: 50%; left: 50%; -webkit-transform: translate(-50%, -50%); transform: translate(-50%, -50%);}
.webgl-content .logo, .progress {position: absolute; left: 50%; top: 50%; -webkit-transform: translate(-50%, -50%); transform: translate(-50%, -50%);}
.webgl-content .logo {background: url('progressLogo.Light.png') no-repeat center / contain; width: 154px; height: 130px;}
.webgl-content .progress {height: 18px; width: 141px; margin-top: 90px;}
.webgl-content .progress .empty {background: url('progressEmpty.Light.png') no-repeat right / cover; float: right; width: 100%; height: 100%; display: inline-block;}
.webgl-content .progress .full {background: url('progressFull.Light.png') no-repeat left / cover; float: left; width: 0%; height: 100%; display: inline-block;}
.webgl-content .logo.Dark {background-image: url('progressLogo.Dark.png');}
.webgl-content .progress.Dark .empty {background-image: url('progressEmpty.Dark.png');}
.webgl-content .progress.Dark .full {background-image: url('progressFull.Dark.png');}
.webgl-content .footer {margin-top: 5px; height: 38px; line-height: 38px; font-family: Helvetica, Verdana, Arial, sans-serif; font-size: 18px;}
.webgl-content .footer .webgl-logo, .title, .fullscreen {height: 100%; display: inline-block; background: transparent center no-repeat;}
.webgl-content .footer .webgl-logo {background-image: url('webgl-logo.png'); width: 204px; float: left;}
.webgl-content .footer .title {margin-right: 10px; float: right;}
.webgl-content .footer .fullscreen {background-image: url('fullscreen.png'); width: 38px; float: right;}

+ 7
- 0
Assets/StreamingAssets/WebGLBuild/TemplateData/style.css.meta View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 574359c93b40a584eb8e6c3b20288a82
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

+ 3
- 0
Assets/StreamingAssets/WebGLBuild/TemplateData/webgl-logo.png View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:f02bcd2abdd299a100ab8e2a339b3f414727816901ecda211d68cb7ba0705da0
size 3587

+ 7
- 0
Assets/StreamingAssets/WebGLBuild/TemplateData/webgl-logo.png.meta View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 8b37961fac5d1b54cbada2dad0851247
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

+ 25
- 0
Assets/StreamingAssets/WebGLBuild/index.html View File

@ -0,0 +1,25 @@
<!DOCTYPE html>
<html lang="en-us">
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Unity WebGL Player | Pet.Move()</title>
<link rel="shortcut icon" href="TemplateData/favicon.ico">
<link rel="stylesheet" href="TemplateData/style.css">
<script src="TemplateData/UnityProgress.js"></script>
<script src="Build/UnityLoader.js"></script>
<script>
var gameInstance = UnityLoader.instantiate("gameContainer", "Build/WebGLBuild.json", {onProgress: UnityProgress});
</script>
</head>
<body>
<div class="webgl-content">
<div id="gameContainer" style="width: 960px; height: 600px"></div>
<div class="footer">
<div class="webgl-logo"></div>
<div class="fullscreen" onclick="gameInstance.SetFullscreen(1)"></div>
<div class="title">Pet.Move()</div>
</div>
</div>
</body>
</html>

+ 7
- 0
Assets/StreamingAssets/WebGLBuild/index.html.meta View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 1fc0652772fa71a4d914ad5d76a0d9d6
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

+ 2
- 2
ProjectSettings/GraphicsSettings.asset View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:758221ccdd8ed2b386a3367cc69cc6c5466fe975c0b4a77ac65f68abcdaa7ffd
size 2428
oid sha256:06f2c9c42c3e01f1143d4c15cfe4f316cfab490aba17fde694e466c130d4e3a4
size 2359

Loading…
Cancel
Save