| | 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 | | using UnityEngine.LowLevel; |
| | 6 | |
|
| | 7 | | namespace GDX.Developer.ConsoleCommands |
| | 8 | | { |
| | 9 | | #if UNITY_2022_2_OR_NEWER |
| | 10 | | public class PlayerLoopConsoleCommand : ConsoleCommandBase |
| | 11 | | { |
| | 12 | | /// <inheritdoc /> |
| | 13 | | public override bool Evaluate(float deltaTime) |
| 0 | 14 | | { |
| 0 | 15 | | PlayerLoopSystem loop = PlayerLoop.GetCurrentPlayerLoop(); |
| 0 | 16 | | TextGenerator text = new TextGenerator(); |
| 0 | 17 | | loop.GenerateSystemTree(text); |
| | 18 | |
|
| 0 | 19 | | UnityEngine.Debug.Log(text.ToString()); |
| 0 | 20 | | return true; |
| 0 | 21 | | } |
| | 22 | |
|
| | 23 | | /// <inheritdoc /> |
| | 24 | | public override Console.ConsoleAccessLevel GetAccessLevel() |
| 0 | 25 | | { |
| 0 | 26 | | return Console.ConsoleAccessLevel.Developer; |
| 0 | 27 | | } |
| | 28 | |
|
| | 29 | | /// <inheritdoc /> |
| | 30 | | public override string GetKeyword() |
| 7 | 31 | | { |
| 7 | 32 | | return "playerloop"; |
| 7 | 33 | | } |
| | 34 | |
|
| | 35 | | /// <inheritdoc /> |
| | 36 | | public override string GetHelpMessage() |
| 0 | 37 | | { |
| 0 | 38 | | return "Output a structured list of the the current systems in Unity's player loop."; |
| 0 | 39 | | } |
| | 40 | | } |
| | 41 | | #endif // UNITY_2022_2_OR_NEWER |
| | 42 | | } |