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.
|
- #if UNITY_5 || UNITY_5_3_OR_NEWER
- using System.Collections;
- using UnityEngine;
-
- namespace Svelto.ECS.Schedulers.Unity
- {
- class MonoScheduler : MonoBehaviour
- {
- public MonoScheduler()
- {
- _coroutine = Coroutine();
- }
-
- void Update()
- {
- _coroutine.MoveNext();
- }
-
- IEnumerator Coroutine()
- {
- while (true)
- {
- yield return _wait;
-
- onTick();
- }
- }
-
- readonly WaitForEndOfFrame _wait = new WaitForEndOfFrame();
- readonly IEnumerator _coroutine;
-
- internal System.Action onTick;
- }
- }
- #endif
|