UniVRM/Assets/VRM/DepthFirstScheduler
2020-11-17 15:57:44 +09:00
..
Editor Rearrange directory structures to support Assembly Definition Files. Add asmdef files 2019-01-29 18:07:48 +09:00
Scheduler Move Assets/* (expect Plugins) to Assets/VRM/* 2018-12-29 13:21:42 +09:00
DepthFirstScheduler.asmdef Rearrange directory structures to support Assembly Definition Files. Add asmdef files 2019-01-29 18:07:48 +09:00
DepthFirstScheduler.asmdef.meta Rearrange directory structures to support Assembly Definition Files. Add asmdef files 2019-01-29 18:07:48 +09:00
Editor.meta Move Assets/* (expect Plugins) to Assets/VRM/* 2018-12-29 13:21:42 +09:00
Functor.cs ContinueWithCoroutine method supports a return value and a argument 2020-07-01 12:36:44 +09:00
Functor.cs.meta Move Assets/* (expect Plugins) to Assets/VRM/* 2018-12-29 13:21:42 +09:00
IEnumeratorExtensions.cs Fix typo (public class members) 2019-06-09 01:23:22 +09:00
IEnumeratorExtensions.cs.meta Move Assets/* (expect Plugins) to Assets/VRM/* 2018-12-29 13:21:42 +09:00
LICENSE Move Assets/* (expect Plugins) to Assets/VRM/* 2018-12-29 13:21:42 +09:00
LICENSE.meta Move Assets/* (expect Plugins) to Assets/VRM/* 2018-12-29 13:21:42 +09:00
LockQueue.cs Move Assets/* (expect Plugins) to Assets/VRM/* 2018-12-29 13:21:42 +09:00
LockQueue.cs.meta Move Assets/* (expect Plugins) to Assets/VRM/* 2018-12-29 13:21:42 +09:00
MainThreadDispatcher.cs Fix typo 2019-05-09 20:06:33 +09:00
MainThreadDispatcher.cs.meta Move Assets/* (expect Plugins) to Assets/VRM/* 2018-12-29 13:21:42 +09:00
MonitorQueue.cs Move Assets/* (expect Plugins) to Assets/VRM/* 2018-12-29 13:21:42 +09:00
MonitorQueue.cs.meta Move Assets/* (expect Plugins) to Assets/VRM/* 2018-12-29 13:21:42 +09:00
README.md Move Assets/* (expect Plugins) to Assets/VRM/* 2018-12-29 13:21:42 +09:00
README.md.meta Move Assets/* (expect Plugins) to Assets/VRM/* 2018-12-29 13:21:42 +09:00
Schedulable.cs fix Error message 2020-11-17 15:57:44 +09:00
Schedulable.cs.meta Move Assets/* (expect Plugins) to Assets/VRM/* 2018-12-29 13:21:42 +09:00
Scheduler.cs Move Assets/* (expect Plugins) to Assets/VRM/* 2018-12-29 13:21:42 +09:00
Scheduler.cs.meta Move Assets/* (expect Plugins) to Assets/VRM/* 2018-12-29 13:21:42 +09:00
Scheduler.meta Move Assets/* (expect Plugins) to Assets/VRM/* 2018-12-29 13:21:42 +09:00
TaskChain.cs Fix typo (Scheduler) 2019-06-09 01:21:45 +09:00
TaskChain.cs.meta Move Assets/* (expect Plugins) to Assets/VRM/* 2018-12-29 13:21:42 +09:00
Unit.cs Move Assets/* (expect Plugins) to Assets/VRM/* 2018-12-29 13:21:42 +09:00
Unit.cs.meta Move Assets/* (expect Plugins) to Assets/VRM/* 2018-12-29 13:21:42 +09:00

DepthFirstScheduler(深さ優先スケジューラー)

Asynchronous task scheduler for Unity-5.6 or later

これは、Unity5.6でTaskが無いことを補完するためのライブラリです。 木構造にタスクを組み立てて深さ優先で消化します。

  • タスクの実行スケジューラー(Unityメインスレッドやスレッドプール)を指定できる

使い方

var schedulable = new Schedulable<Unit>();

schedulable
    .AddTask(Scheduler.ThreadPool, () => // 子供のタスクを追加する
    {
        return glTF_VRM_Material.Parse(ctx.Json);
    })
    .ContinueWith(Scheduler.MainThread, gltfMaterials => // 兄弟のタスクを追加する
    {
        ctx.MaterialImporter = new VRMMaterialImporter(ctx, gltfMaterials);
    })
    .Subscribe(Scheduler.MainThread, onLoaded, onError);
    ;

Schedulable

T型の結果を返すタスク。

AddTask(IScheduler scheduler, Func firstTask)

子供のタスクを追加する。

ToDo: 一つ目の子供に引数を渡す手段が無い

ContinueWith

ContinueWithCoroutine

OnExecute

動的にタスクを追加するためのHook。

中で、

parent.AddTask

することで実行時に子タスクを追加できる。

Subscribe

タスクの実行を開始する。 実行結果を得る。

Scheduler

StepScheduler

Unity

CurrentThreadScheduler

即時

ThreadPoolScheduler

スレッド

ThreadScheduler

スレッド