12
12
using System . Collections . Generic ;
13
13
using Supyrb . Attributes ;
14
14
using UnityEngine ;
15
+ using UnityEngine . Rendering ;
15
16
16
17
namespace Supyrb
17
18
{
@@ -54,6 +55,17 @@ public void LogMemory()
54
55
WebGlPlugins . LogMemory ( ) ;
55
56
}
56
57
58
+ /// <summary>
59
+ /// Unloads all unused assets <see cref="Resources.UnloadUnusedAssets"/>
60
+ /// Browser Usage: <code>unityGame.SendMessage("WebGL","UnloadUnusedAssets");</code>
61
+ /// </summary>
62
+ [ WebGlCommand ( Description = "Resources.UnloadUnusedAssets" ) ]
63
+ [ ContextMenu ( nameof ( UnloadUnusedAssets ) ) ]
64
+ public void UnloadUnusedAssets ( )
65
+ {
66
+ Resources . UnloadUnusedAssets ( ) ;
67
+ }
68
+
57
69
/// <summary>
58
70
/// Sets if the application should run while not focused.
59
71
/// It is in background while another tab is focused or the console is focused
@@ -178,5 +190,27 @@ public void LogTextureSupport()
178
190
Debug . Log ( $ "Supported Texture formats: \n { string . Join ( ", " , supportedFormats ) } ") ;
179
191
Debug . Log ( $ "Unsupported Texture formats: \n { string . Join ( ", " , unsupportedFormats ) } ") ;
180
192
}
193
+
194
+ /// <summary>
195
+ /// Deletes all player prefs <see cref="PlayerPrefs.DeleteAll"/>
196
+ /// </summary>
197
+ [ WebGlCommand ( Description = "PlayerPrefs.DeleteAll" ) ]
198
+ [ ContextMenu ( nameof ( DeleteAllPlayerPrefs ) ) ]
199
+ public void DeleteAllPlayerPrefs ( )
200
+ {
201
+ PlayerPrefs . DeleteAll ( ) ;
202
+ }
203
+
204
+ /// <summary>
205
+ /// Log shader compilation in debug builds (no effect in release builds)
206
+ /// <see cref="GraphicsSettings.logWhenShaderIsCompiled "/>
207
+ /// </summary>
208
+ /// <param name="runInBackground">1 if it should run in background</param>
209
+ [ WebGlCommand ( Description = "GraphicsSettings.logWhenShaderIsCompiled" ) ]
210
+ [ ContextMenu ( nameof ( LogShaderCompilation ) ) ]
211
+ public void LogShaderCompilation ( int enabled )
212
+ {
213
+ GraphicsSettings . logWhenShaderIsCompiled = enabled == 1 ;
214
+ }
181
215
}
182
216
}
0 commit comments