@@ -34,10 +34,6 @@ public static class WebToolPlugins
34
34
private static extern string _GetUserAgent ( ) ;
35
35
[ DllImport ( "__Internal" ) ]
36
36
private static extern uint _GetTotalMemorySize ( ) ;
37
- [ DllImport ( "__Internal" ) ]
38
- private static extern uint _GetStaticMemorySize ( ) ;
39
- [ DllImport ( "__Internal" ) ]
40
- private static extern uint _GetDynamicMemorySize ( ) ;
41
37
#endif
42
38
43
39
private static bool _infoPanelVisible = false ;
@@ -154,82 +150,31 @@ public static bool IsMobileDevice()
154
150
userAgent . Contains ( "Android" ) ;
155
151
}
156
152
157
- /// <summary>
158
- /// Get the total memory size used by the application in MB
159
- /// </summary>
160
- /// <returns>Size in MB</returns>
161
- public static float GetTotalMemorySize ( )
162
- {
163
- #if UNITY_WEBGL && ! UNITY_EDITOR
164
- var bytes = _GetTotalMemorySize ( ) ;
165
- return GetMegaBytes ( bytes ) ;
166
- #elif UNITY_EDITOR && WEBTOOLS_LOG_CALLS
167
- Debug . Log ( $ "{ nameof ( WebToolPlugins ) } .{ nameof ( GetTotalMemorySize ) } called") ;
168
- return - 1f ;
169
- #else
170
- return - 1f ;
171
- #endif
172
- }
173
-
174
153
/// <summary>
175
154
/// Log all current memory data in MB
176
155
/// </summary>
177
156
public static void LogMemory ( )
178
157
{
179
158
#if UNITY_WEBGL && ! UNITY_EDITOR
180
159
var managed = GetManagedMemorySize ( ) ;
181
- var native = GetNativeMemorySize ( ) ;
182
160
var total = GetTotalMemorySize ( ) ;
183
- Debug . Log ( $ "Memory stats:\n Managed: { managed : 0.00} MB\n Native: { native : 0.00 } MB \ n Total: { total : 0.00} MB") ;
161
+ Debug . Log ( $ "Memory stats:\n Managed: { managed : 0.00} MB\n Total: { total : 0.00} MB") ;
184
162
#elif UNITY_EDITOR && WEBTOOLS_LOG_CALLS
185
163
Debug . Log ( $ "{ nameof ( WebToolPlugins ) } .{ nameof ( LogMemory ) } called") ;
186
164
#endif
187
165
}
188
166
189
167
/// <summary>
190
- /// Get the static memory size used by the application in MB
191
- /// </summary>
192
- /// <returns>Size in MB</returns>
193
- public static float GetStaticMemorySize ( )
194
- {
195
- #if UNITY_WEBGL && ! UNITY_EDITOR
196
- var bytes = _GetStaticMemorySize ( ) ;
197
- return GetMegaBytes ( bytes ) ;
198
- #elif UNITY_EDITOR && WEBTOOLS_LOG_CALLS
199
- Debug . Log ( $ "{ nameof ( WebToolPlugins ) } .{ nameof ( GetStaticMemorySize ) } called") ;
200
- return - 1f ;
201
- #else
202
- return - 1f ;
203
- #endif
204
- }
205
-
206
- /// <summary>
207
- /// Get the dynamic memory size used by the application in MB
168
+ /// Get the total memory size used by the application in MB
208
169
/// </summary>
209
170
/// <returns>Size in MB</returns>
210
- public static float GetDynamicMemorySize ( )
171
+ public static float GetTotalMemorySize ( )
211
172
{
212
173
#if UNITY_WEBGL && ! UNITY_EDITOR
213
- var bytes = _GetStaticMemorySize ( ) ;
174
+ var bytes = _GetTotalMemorySize ( ) ;
214
175
return GetMegaBytes ( bytes ) ;
215
176
#elif UNITY_EDITOR && WEBTOOLS_LOG_CALLS
216
- Debug . Log ( $ "{ nameof ( WebToolPlugins ) } .{ nameof ( GetDynamicMemorySize ) } called") ;
217
- return - 1f ;
218
- #else
219
- return - 1f ;
220
- #endif
221
- }
222
-
223
- /// <summary>
224
- /// Get the native memory size used by the application in MB (Static + Dynamic memory)
225
- /// </summary>
226
- /// <returns>Size in MB</returns>
227
- public static float GetNativeMemorySize ( )
228
- {
229
- #if UNITY_WEBGL && ! UNITY_EDITOR
230
- return GetDynamicMemorySize ( ) + GetStaticMemorySize ( ) ;
231
- #elif UNITY_EDITOR && WEBTOOLS_LOG_CALLS
232
- Debug . Log ( $ "{ nameof ( WebToolPlugins ) } .{ nameof ( GetNativeMemorySize ) } called") ;
177
+ Debug . Log ( $ "{ nameof ( WebToolPlugins ) } .{ nameof ( GetTotalMemorySize ) } called") ;
233
178
return - 1f ;
234
179
#else
235
180
return - 1f ;
0 commit comments