Inheritance: IExecuteSystem, ISetPool
 public CoroutinePool(int poolSize)
 {
     this._poolSize = poolSize;
     _coroutines    = new CoroutineSystem[poolSize];
     for (var i = 0; i < _poolSize; i++)
     {
         _coroutines[i] = new CoroutineSystem();
     }
 }
示例#2
0
        public void Init()
        {
            c      = 0;
            system = new CoroutineSystem();             //create the coroutine system
            Coroutine routine = new Coroutine {
                Function = Hello()
            };

            system.AddCoroutine(routine);
        }
        public override void OnStart()
        {
            ReduceCounter = new ReduceCounter(15 * 1000);
            AddProgressBar(ReduceCounter);
            ReduceCounter.OnFinishedAsync.Subscribe(_ => ParupunteEnd());

            StartCoroutine(SwapCoroutine());

            _quickCoroutineSystem = new CoroutineSystem();

            var d = core.OnTickAsObservable
                    .Subscribe(_ =>
            {
                _quickCoroutineSystem?.CoroutineLoop();
            });

            this.OnFinishedAsObservable
            .Subscribe(_ =>
            {
                d.Dispose();
                _quickCoroutineSystem.RemoveAllCoroutine();
                _quickCoroutineSystem = null;
            });
        }