| | 1 | | // Copyright (c) 2020-2022 dotBunny Inc. |
| | 2 | | // dotBunny licenses this file to you under the BSL-1.0 license. |
| | 3 | | // See the LICENSE file in the project root for more information. |
| | 4 | |
|
| | 5 | | namespace GDX.Developer.ConsoleCommands |
| | 6 | | { |
| | 7 | | #if UNITY_2022_2_OR_NEWER |
| | 8 | | public class GarbageCollectionConsoleCommand : ConsoleCommandBase |
| | 9 | | { |
| | 10 | | /// <inheritdoc /> |
| | 11 | | public override bool Evaluate(float deltaTime) |
| 0 | 12 | | { |
| 0 | 13 | | Memory.CleanUp(); |
| 0 | 14 | | return true; |
| 0 | 15 | | } |
| | 16 | |
|
| | 17 | | /// <inheritdoc /> |
| | 18 | | public override Console.ConsoleAccessLevel GetAccessLevel() |
| 0 | 19 | | { |
| 0 | 20 | | return Console.ConsoleAccessLevel.Anonymous; |
| 0 | 21 | | } |
| | 22 | |
|
| | 23 | | /// <inheritdoc /> |
| | 24 | | public override string GetKeyword() |
| 7 | 25 | | { |
| 7 | 26 | | return "gc"; |
| 7 | 27 | | } |
| | 28 | |
|
| | 29 | | /// <inheritdoc /> |
| | 30 | | public override string GetHelpMessage() |
| 0 | 31 | | { |
| 0 | 32 | | return "Force garbage collection be ran for managed memory."; |
| 0 | 33 | | } |
| | 34 | | } |
| | 35 | | #endif // UNITY_2022_2_OR_NEWER |
| | 36 | | } |