Skip to content

Commit 1d098da

Browse files
committed
Change naming to more general Web instead of WebGL
In the future, this will not be limited to WebGL, but will also include WebGPU
1 parent 4f683b3 commit 1d098da

20 files changed

+126
-93
lines changed
File renamed without changes.

Assets/Plugins/WebGL/WebGLTools/Attributes/WebGlCommandAttribute.cs renamed to Assets/Plugins/WebGL/WebTools/Attributes/WebGlCommandAttribute.cs

File renamed without changes.

Assets/Plugins/WebGL/WebGLTools/Attributes/WebGlCommandAttribute.cs.meta renamed to Assets/Plugins/WebGL/WebTools/Attributes/WebGlCommandAttribute.cs.meta

File renamed without changes.

Assets/Plugins/WebGL/WebGLTools/Supyrb.WebGLTools.asmdef renamed to Assets/Plugins/WebGL/WebTools/Supyrb.WebTools.asmdef

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "Supyrb.WebGLTools",
2+
"name": "Supyrb.WebTools",
33
"rootNamespace": "",
44
"references": [],
55
"includePlatforms": [

Assets/Plugins/WebGL/WebGLTools/Supyrb.WebGLTools.asmdef.meta renamed to Assets/Plugins/WebGL/WebTools/Supyrb.WebTools.asmdef.meta

File renamed without changes.

Assets/Plugins/WebGL/WebGLTools/WebGlBridge.Commands.cs renamed to Assets/Plugins/WebGL/WebTools/WebBridge.Commands.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ namespace Supyrb
1919
/// <summary>
2020
/// Add commands to the WebGL bridge to expose them to the browser console
2121
/// </summary>
22-
public partial class WebGlBridge
22+
public partial class WebBridge
2323
{
2424
/// <summary>
2525
/// Disable capturing all keyboard input, e.g. for using native html input fields
@@ -55,7 +55,7 @@ public void EnableCaptureAllKeyboardInput()
5555
[ContextMenu(nameof(LogMemory))]
5656
public void LogMemory()
5757
{
58-
WebGlPlugins.LogMemory();
58+
WebToolPlugins.LogMemory();
5959
}
6060

6161
/// <summary>
@@ -122,7 +122,7 @@ public void SetTimeTimeScale(float timeScale)
122122
[WebGlCommand(Description = "Toggle develop ui visibility of InfoPanel")]
123123
public void ToggleInfoPanel()
124124
{
125-
WebGlPlugins.ToggleInfoPanel();
125+
WebToolPlugins.ToggleInfoPanel();
126126
}
127127

128128
/// <summary>
@@ -132,8 +132,8 @@ public void ToggleInfoPanel()
132132
[WebGlCommand(Description = "Log User Agent and isMobileDevice")]
133133
public void LogUserAgent()
134134
{
135-
string userAgent = WebGlPlugins.GetUserAgent();
136-
bool isMobileDevice = WebGlPlugins.IsMobileDevice();
135+
string userAgent = WebToolPlugins.GetUserAgent();
136+
bool isMobileDevice = WebToolPlugins.IsMobileDevice();
137137
Debug.Log($"<color=#4D65A4>User Agent:</color> '{userAgent}', <color=#4D65A4>IsMobileDevice:</color> '{isMobileDevice}'");
138138
}
139139

Assets/Plugins/WebGL/WebGLTools/WebGlBridge.Commands.cs.meta renamed to Assets/Plugins/WebGL/WebTools/WebBridge.Commands.cs.meta

File renamed without changes.

Assets/Plugins/WebGL/WebGLTools/WebGlBridge.cs renamed to Assets/Plugins/WebGL/WebTools/WebBridge.cs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,41 +18,41 @@ namespace Supyrb
1818
{
1919
/// <summary>
2020
/// Bridge to Unity to access unity logic through the browser console
21-
/// You can extend your commands by creating a partial class for WebGLBridge, see WebGLBridge.Commands as an example
21+
/// You can extend your commands by creating a partial class for WebBridge, see WebBridge.Commands as an example
2222
/// </summary>
23-
public partial class WebGlBridge : MonoBehaviour
23+
public partial class WebBridge : MonoBehaviour
2424
{
2525
#if UNITY_WEBGL
2626
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]
2727
private static void OnBeforeSceneLoadRuntimeMethod()
2828
{
2929
SetGlobalVariables();
30-
var bridgeInstance = new GameObject("WebGL");
30+
var bridgeInstance = new GameObject("Web");
3131
DontDestroyOnLoad(bridgeInstance);
32-
bridgeInstance.AddComponent<WebGlBridge>();
32+
bridgeInstance.AddComponent<WebBridge>();
3333
}
3434
#endif
3535

3636
private static void SetGlobalVariables()
3737
{
3838
var graphicsDevice = SystemInfo.graphicsDeviceType;
39-
string webGl = string.Empty;
39+
string webGraphics = string.Empty;
4040
switch (graphicsDevice)
4141
{
4242
case GraphicsDeviceType.OpenGLES2:
43-
webGl = "WebGL 1";
43+
webGraphics = "WebGL 1";
4444
break;
4545
case GraphicsDeviceType.OpenGLES3:
46-
webGl = "WebGL 2";
46+
webGraphics = "WebGL 2";
4747
break;
4848
default:
49-
webGl = graphicsDevice.ToString();
49+
webGraphics = graphicsDevice.ToString();
5050
break;
5151
}
52-
WebGlPlugins.SetVariable("webGlVersion", webGl);
53-
WebGlPlugins.SetVariable("unityVersion", Application.unityVersion);
52+
WebToolPlugins.SetVariable("webGlVersion", webGraphics);
53+
WebToolPlugins.SetVariable("unityVersion", Application.unityVersion);
5454
#if !UNITY_EDITOR && UNITY_WEBGL
55-
WebGlPlugins.SetVariable("unityCaptureAllKeyboardInputDefault", WebGLInput.captureAllKeyboardInput?"true":"false");
55+
WebToolPlugins.SetVariable("unityCaptureAllKeyboardInputDefault", WebGLInput.captureAllKeyboardInput?"true":"false");
5656
#endif
5757
}
5858

File renamed without changes.

0 commit comments

Comments
 (0)