Moar Gamecraft commands!
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 line
786B

  1. using Svelto.ECS;
  2. using UnityEngine;
  3. //using Svelto.Context;
  4. using GamecraftModdingAPI.Commands;
  5. namespace ExtraCommands.Basics
  6. {
  7. [CustomCommand("SetTargetFPS")]
  8. class SetTargetFramerateCommandEngine : ICustomCommandEngine
  9. {
  10. public string Description => "Set Gamecraft's target FPS'";
  11. public string Name => "SetTargetFPS";
  12. public EntitiesDB entitiesDB { set; private get; }
  13. public bool isRemovable => true;
  14. public void Ready()
  15. {
  16. CommandRegistrationHelper.Register<int>(Name, SetFramerateCommand, Description);
  17. }
  18. private void SetFramerateCommand(int newFoV)
  19. {
  20. Application.targetFrameRate = newFoV;
  21. }
  22. public void Dispose()
  23. {
  24. CommandRegistrationHelper.Unregister(Name);
  25. }
  26. }
  27. }