@@ -19,13 +19,13 @@ namespace Supyrb
1919 /// <summary>
2020 /// Add commands to the WebGL bridge to expose them to the browser console
2121 /// </summary>
22- public partial class WebBridge
22+ public class CommonCommands : WebCommands
2323 {
2424 /// <summary>
2525 /// Disable capturing all keyboard input, e.g. for using native html input fields
2626 /// Browser Usage: <code>unityGame.SendMessage("WebGL","DisableCaptureAllKeyboardInput");</code>
2727 /// </summary>
28- [ WebGlCommand ( Description = "Disable unity from consuming all keyboard input" ) ]
28+ [ WebCommand ( Description = "Disable unity from consuming all keyboard input" ) ]
2929 public void DisableCaptureAllKeyboardInput ( )
3030 {
3131#if ! UNITY_EDITOR && UNITY_WEBGL
@@ -38,7 +38,7 @@ public void DisableCaptureAllKeyboardInput()
3838 /// Enable capturing all keyboard input, to make sure the game does not miss any key strokes
3939 /// Browser Usage: <code>unityGame.SendMessage("WebGL","EnableCaptureAllKeyboardInput");</code>
4040 /// </summary>
41- [ WebGlCommand ( Description = "Enable unity from consuming all keyboard input" ) ]
41+ [ WebCommand ( Description = "Enable unity from consuming all keyboard input" ) ]
4242 public void EnableCaptureAllKeyboardInput ( )
4343 {
4444#if ! UNITY_EDITOR && UNITY_WEBGL
@@ -51,7 +51,7 @@ public void EnableCaptureAllKeyboardInput()
5151 /// Logs the current memory usage
5252 /// Browser Usage: <code>unityGame.SendMessage("WebGL","LogMemory");</code>
5353 /// </summary>
54- [ WebGlCommand ( Description = "Logs the current memory" ) ]
54+ [ WebCommand ( Description = "Logs the current memory" ) ]
5555 [ ContextMenu ( nameof ( LogMemory ) ) ]
5656 public void LogMemory ( )
5757 {
@@ -62,7 +62,7 @@ public void LogMemory()
6262 /// Unloads all unused assets <see cref="Resources.UnloadUnusedAssets"/>
6363 /// Browser Usage: <code>unityGame.SendMessage("WebGL","UnloadUnusedAssets");</code>
6464 /// </summary>
65- [ WebGlCommand ( Description = "Resources.UnloadUnusedAssets" ) ]
65+ [ WebCommand ( Description = "Resources.UnloadUnusedAssets" ) ]
6666 [ ContextMenu ( nameof ( UnloadUnusedAssets ) ) ]
6767 public void UnloadUnusedAssets ( )
6868 {
@@ -75,7 +75,7 @@ public void UnloadUnusedAssets()
7575 /// Browser Usage: <code>unityGame.SendMessage("WebGL", "SetApplicationRunInBackground", 1);</code>
7676 /// </summary>
7777 /// <param name="runInBackground">1 if it should run in background</param>
78- [ WebGlCommand ( Description = "Application.runInBackground" ) ]
78+ [ WebCommand ( Description = "Application.runInBackground" ) ]
7979 public void SetApplicationRunInBackground ( int runInBackground )
8080 {
8181 Application . runInBackground = runInBackground == 1 ;
@@ -86,7 +86,7 @@ public void SetApplicationRunInBackground(int runInBackground)
8686 /// Browser Usage: <code>unityGame.SendMessage("WebGL", "SetApplicationTargetFrameRate", 15);</code>
8787 /// </summary>
8888 /// <param name="targetFrameRate">frame rate to render in</param>
89- [ WebGlCommand ( Description = "Application.targetFrameRate" ) ]
89+ [ WebCommand ( Description = "Application.targetFrameRate" ) ]
9090 public void SetApplicationTargetFrameRate ( int targetFrameRate )
9191 {
9292 Application . targetFrameRate = targetFrameRate ;
@@ -97,7 +97,7 @@ public void SetApplicationTargetFrameRate(int targetFrameRate)
9797 /// Browser Usage: <code>unityGame.SendMessage("WebGL", "SetTimeFixedDeltaTime", 0.02);</code>
9898 /// </summary>
9999 /// <param name="fixedDeltaTime"></param>
100- [ WebGlCommand ( Description = "Time.fixedDeltaTime" ) ]
100+ [ WebCommand ( Description = "Time.fixedDeltaTime" ) ]
101101 public void SetTimeFixedDeltaTime ( float fixedDeltaTime )
102102 {
103103 Time . fixedDeltaTime = fixedDeltaTime ;
@@ -109,7 +109,7 @@ public void SetTimeFixedDeltaTime(float fixedDeltaTime)
109109 /// Browser Usage: <code>unityGame.SendMessage("WebGL", "SetTimeTimeScale", 0.2);</code>
110110 /// </summary>
111111 /// <param name="timeScale">new timescale value</param>
112- [ WebGlCommand ( Description = "Time.timeScale" ) ]
112+ [ WebCommand ( Description = "Time.timeScale" ) ]
113113 public void SetTimeTimeScale ( float timeScale )
114114 {
115115 Time . timeScale = timeScale ;
@@ -119,7 +119,7 @@ public void SetTimeTimeScale(float timeScale)
119119 /// Toggle the visibility of the info panel in the top right corner
120120 /// Browser Usage: <code>unityGame.SendMessage("WebGL", "ToggleInfoPanel");</code>
121121 /// </summary>
122- [ WebGlCommand ( Description = "Toggle develop ui visibility of InfoPanel" ) ]
122+ [ WebCommand ( Description = "Toggle develop ui visibility of InfoPanel" ) ]
123123 public void ToggleInfoPanel ( )
124124 {
125125 WebToolPlugins . ToggleInfoPanel ( ) ;
@@ -129,7 +129,7 @@ public void ToggleInfoPanel()
129129 /// Log the user agent of the browser and if this agent is classified as mobile
130130 /// Browser Usage: <code>unityGame.SendMessage("WebGL", "LogUserAgent");</code>
131131 /// </summary>
132- [ WebGlCommand ( Description = "Log User Agent and isMobileDevice" ) ]
132+ [ WebCommand ( Description = "Log User Agent and isMobileDevice" ) ]
133133 public void LogUserAgent ( )
134134 {
135135 string userAgent = WebToolPlugins . GetUserAgent ( ) ;
@@ -140,7 +140,7 @@ public void LogUserAgent()
140140 /// <summary>
141141 /// Log example messages to show off unity rich text parsing to html & console styling
142142 /// </summary>
143- [ WebGlCommand ( Description = "Log example messages for Log, warning and error" ) ]
143+ [ WebCommand ( Description = "Log example messages for Log, warning and error" ) ]
144144 [ ContextMenu ( nameof ( LogExampleMessages ) ) ]
145145 public void LogExampleMessages ( )
146146 {
@@ -153,7 +153,7 @@ public void LogExampleMessages()
153153 /// Log a custom message to test Debug.Log in general
154154 /// </summary>
155155 /// <param name="message">Message that will be logged</param>
156- [ WebGlCommand ( Description = "Log a custom message" ) ]
156+ [ WebCommand ( Description = "Log a custom message" ) ]
157157 public void LogMessage ( string message )
158158 {
159159 Debug . Log ( message ) ;
@@ -162,7 +162,7 @@ public void LogMessage(string message)
162162 /// <summary>
163163 /// Throw an exception from System namespace to see how stack traces look for that
164164 /// </summary>
165- [ WebGlCommand ( Description = "Throw a dictionary key not found exception" ) ]
165+ [ WebCommand ( Description = "Throw a dictionary key not found exception" ) ]
166166 [ ContextMenu ( nameof ( ThrowDictionaryException ) ) ]
167167 public void ThrowDictionaryException ( )
168168 {
@@ -175,7 +175,7 @@ public void ThrowDictionaryException()
175175 /// Log information of all texture formats that Unity supports, which ones are supported by
176176 /// the current platform and browser, and which ones are not supported
177177 /// </summary>
178- [ WebGlCommand ( Description = "Log supported and unsupported texture formats" ) ]
178+ [ WebCommand ( Description = "Log supported and unsupported texture formats" ) ]
179179 [ ContextMenu ( nameof ( LogTextureSupport ) ) ]
180180 public void LogTextureSupport ( )
181181 {
@@ -209,7 +209,7 @@ public void LogTextureSupport()
209209 /// <summary>
210210 /// Deletes all player prefs <see cref="PlayerPrefs.DeleteAll"/>
211211 /// </summary>
212- [ WebGlCommand ( Description = "PlayerPrefs.DeleteAll" ) ]
212+ [ WebCommand ( Description = "PlayerPrefs.DeleteAll" ) ]
213213 [ ContextMenu ( nameof ( DeleteAllPlayerPrefs ) ) ]
214214 public void DeleteAllPlayerPrefs ( )
215215 {
@@ -221,7 +221,7 @@ public void DeleteAllPlayerPrefs()
221221 /// <see cref="GraphicsSettings.logWhenShaderIsCompiled "/>
222222 /// </summary>
223223 /// <param name="runInBackground">1 if it should run in background</param>
224- [ WebGlCommand ( Description = "GraphicsSettings.logWhenShaderIsCompiled" ) ]
224+ [ WebCommand ( Description = "GraphicsSettings.logWhenShaderIsCompiled" ) ]
225225 [ ContextMenu ( nameof ( LogShaderCompilation ) ) ]
226226 public void LogShaderCompilation ( int enabled )
227227 {
0 commit comments