Mirror of Svelto.ECS because we're a fan of it
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.

GodotScheduler.cs 628B

123456789101112131415161718192021222324252627282930
  1. #if GODOT
  2. using Godot;
  3. namespace Svelto.ECS.Schedulers.Godot
  4. {
  5. /// <summary>
  6. /// Unlike Unity, in godot Everything is a Node. Monobehaviour = Node, GameObject = Node etc.
  7. /// </summary>
  8. public partial class GodotScheduler : Node
  9. {
  10. internal System.Action onTick;
  11. public override void _Process(double delta)
  12. {
  13. Routine();
  14. }
  15. public async void Routine()
  16. {
  17. while (true)
  18. {
  19. await ToSignal(GetTree(), "process_frame");
  20. onTick();
  21. }
  22. }
  23. }
  24. }
  25. #endif