TimeCommands.cs 479 B

12345678910111213141516171819
  1. using UnityEngine;
  2. namespace IngameDebugConsole.Commands
  3. {
  4. public class TimeCommands
  5. {
  6. [ConsoleMethod( "time.scale", "Sets the Time.timeScale value" ), UnityEngine.Scripting.Preserve]
  7. public static void SetTimeScale( float value )
  8. {
  9. Time.timeScale = Mathf.Max( value, 0f );
  10. }
  11. [ConsoleMethod( "time.scale", "Returns the current Time.timeScale value" ), UnityEngine.Scripting.Preserve]
  12. public static float GetTimeScale()
  13. {
  14. return Time.timeScale;
  15. }
  16. }
  17. }