public SequentialMonoRunner(string name, bool mustSurvive = false) : base(name)
        {
            UnityCoroutineRunner.InitializeGameObject(name, ref _go, mustSurvive);

            var runnerBehaviour = _go.AddComponent <RunnerBehaviourUpdate>();
            var info            = new UnityCoroutineRunner.RunningTasksInfo {
                runnerName = name
            };

            runnerBehaviour.StartUpdateCoroutine(new UnityCoroutineRunner.Process <UnityCoroutineRunner.RunningTasksInfo>
                                                     (_newTaskRoutines, _coroutines, _flushingOperation, info));
        }
        public EarlyUpdateMonoRunner(UpdateMonoRunner updateRunner, string name) : base(name)
        {
            _go = updateRunner._go;

            var runnerBehaviour = _go.GetComponent <RunnerBehaviourUpdate>();

            var info = new UnityCoroutineRunner.RunningTasksInfo()
            {
                runnerName = name
            };

            runnerBehaviour.StartEarlyUpdateCoroutine(new UnityCoroutineRunner.Process <UnityCoroutineRunner.RunningTasksInfo>
                                                          (_newTaskRoutines, _coroutines, _flushingOperation, info));
        }
        public CoroutineMonoRunner(string name, bool mustSurvive = false) : base(name)
        {
            UnityCoroutineRunner.InitializeGameObject(name, ref _go, mustSurvive);

            _runnerBehaviour = _go.AddComponent <RunnerBehaviour>();

            var info = new UnityCoroutineRunner.RunningTasksInfo {
                runnerName = name
            };

            _processEnumerator = new UnityCoroutineRunner.Process <UnityCoroutineRunner.RunningTasksInfo>
                                     (_newTaskRoutines, _coroutines, _flushingOperation, info);

            _runnerBehaviour.StartCoroutine(_processEnumerator);
        }
示例#4
0
        public CoroutineMonoRunner(string name, bool mustSurvive = false)
        {
            UnityCoroutineRunner.InitializeGameObject(name, ref _go, mustSurvive);

            RunnerBehaviour runnerBehaviour = _go.AddComponent <RunnerBehaviour>();
            var             runnerBehaviourForUnityCoroutine = _go.AddComponent <RunnerBehaviour>();

            _info = new UnityCoroutineRunner.RunningTasksInfo {
                runnerName = name
            };

            runnerBehaviour.StartCoroutine(new UnityCoroutineRunner.Process(
                                               _newTaskRoutines, _coroutines, _flushingOperation, _info,
                                               UnityCoroutineRunner.StandardTasksFlushing,
                                               runnerBehaviourForUnityCoroutine, StartCoroutine));
        }
        public EarlyUpdateMonoRunner(UpdateMonoRunner updateRunner, string name)
        {
            _go = updateRunner._go;

            var runnerBehaviour = _go.GetComponent <RunnerBehaviourUpdate>();
            var runnerBehaviourForUnityCoroutine = _go.GetComponent <RunnerBehaviour>();

            var info = new UnityCoroutineRunner.RunningTasksInfo {
                runnerName = name
            };

            runnerBehaviour.StartEarlyUpdateCoroutine(new UnityCoroutineRunner.Process
                                                          (_newTaskRoutines, _coroutines, _flushingOperation, info,
                                                          UnityCoroutineRunner.StandardTasksFlushing,
                                                          runnerBehaviourForUnityCoroutine, StartCoroutine));
        }
        public UpdateMonoRunner(string name)
        {
            UnityCoroutineRunner.InitializeGameObject(name, ref _go);

            var coroutines      = new FasterList <IPausableTask>(NUMBER_OF_INITIAL_COROUTINE);
            var runnerBehaviour = _go.AddComponent <RunnerBehaviourUpdate>();
            var runnerBehaviourForUnityCoroutine = _go.AddComponent <RunnerBehaviour>();

            _info = new UnityCoroutineRunner.RunningTasksInfo {
                runnerName = name
            };

            runnerBehaviour.StartUpdateCoroutine(UnityCoroutineRunner.Process
                                                     (_newTaskRoutines, coroutines, _flushingOperation, _info,
                                                     UnityCoroutineRunner.StandardTasksFlushing,
                                                     runnerBehaviourForUnityCoroutine, StartCoroutine));
        }
示例#7
0
        public StaggeredMonoRunner(string name, int maxTasksPerFrame, bool mustSurvive = false)
        {
            _flushingOperation = new FlushingOperationStaggered(maxTasksPerFrame);

            UnityCoroutineRunner.InitializeGameObject(name, ref _go, mustSurvive);

            var runnerBehaviour = _go.AddComponent <RunnerBehaviourUpdate>();
            var runnerBehaviourForUnityCoroutine = _go.AddComponent <RunnerBehaviour>();
            var info = new UnityCoroutineRunner.RunningTasksInfo {
                runnerName = name
            };

            runnerBehaviour.StartUpdateCoroutine(new UnityCoroutineRunner.Process
                                                     (_newTaskRoutines, _coroutines, _flushingOperation, info,
                                                     StaggeredTasksFlushing,
                                                     runnerBehaviourForUnityCoroutine, StartCoroutine));
        }
示例#8
0
        public PhysicMonoRunner(string name)
        {
            var go         = UnityCoroutineRunner.InitializeGameobject(name);
            var coroutines = new FasterList <IPausableTask>(NUMBER_OF_INITIAL_COROUTINE);

            var runnerBehaviour = go.AddComponent <RunnerBehaviourPhysic>();
            var runnerBehaviourForUnityCoroutine = go.AddComponent <RunnerBehaviour>();

            _info = new UnityCoroutineRunner.RunningTasksInfo()
            {
                runnerName = name
            };

            runnerBehaviour.StartPhysicCoroutine(UnityCoroutineRunner.Process
                                                     (_newTaskRoutines, coroutines, _flushingOperation, _info,
                                                     UnityCoroutineRunner.StandardTasksFlushing,
                                                     runnerBehaviourForUnityCoroutine, StartCoroutine));
        }
        public StaggeredMonoRunner(string name, int maxTasksPerFrame)
        {
            _flushingOperation = new FlushingOperationStaggered(maxTasksPerFrame);

            var go = UnityCoroutineRunner.InitializeGameobject(name);

            var coroutines      = new FasterList <IPausableTask>(NUMBER_OF_INITIAL_COROUTINE);
            var runnerBehaviour = go.AddComponent <RunnerBehaviourUpdate>();
            var runnerBehaviourForUnityCoroutine = go.AddComponent <RunnerBehaviour>();

            _info = new UnityCoroutineRunner.RunningTasksInfo()
            {
                runnerName = name
            };

            runnerBehaviour.StartUpdateCoroutine(UnityCoroutineRunner.Process
                                                     (_newTaskRoutines, coroutines, _flushingOperation, _info,
                                                     StaggeredTasksFlushing,
                                                     runnerBehaviourForUnityCoroutine, StartCoroutine));
        }