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.
|
- using System;
- using System.Collections;
- using UnityEngine;
-
- namespace Svelto.ECS.NodeSchedulers
- {
- public class UnitySumbmissionNodeScheduler : NodeSubmissionScheduler
- {
- public UnitySumbmissionNodeScheduler()
- {
- GameObject go = new GameObject("ECSScheduler");
-
- _scheduler = go.AddComponent<Scheduler>();
- }
-
- public override void Schedule(Action submitNodes)
- {
- _scheduler.OnTick += submitNodes;
- }
-
- class Scheduler : MonoBehaviour
- {
- IEnumerator Start()
- {
- while (true)
- {
- yield return new WaitForEndOfFrame();
-
- OnTick();
- }
- }
-
- internal Action OnTick;
- }
-
- Scheduler _scheduler;
- }
- }
|