Merge pull request #23 from dwango/unitask_rename

Unitask rename
This commit is contained in:
ousttrue
2018-08-09 13:21:33 +09:00
committed by GitHub
29 changed files with 88 additions and 19 deletions

View File

@@ -1,7 +1,7 @@
using System;
using System.Collections;
namespace UniTask
namespace DepthFirstScheduler
{
public enum ExecutionStatus
{

View File

@@ -2,7 +2,7 @@
using System.Collections.Generic;
namespace UniTask
namespace DepthFirstScheduler
{
public class LockQueue<T> where T : class
{

View File

@@ -2,7 +2,7 @@
using System.Collections.Generic;
using UnityEngine;
namespace UniTask
namespace DepthFirstScheduler
{
/// <summary>
/// UniRxのMainThreadDispatcherを参考にした。

View File

@@ -3,7 +3,7 @@ using System.Collections.Generic;
using System.Threading;
namespace UniTask
namespace DepthFirstScheduler
{
/// <summary>
/// http://blogs.msdn.com/b/toub/archive/2006/04/12/blocking-queues.aspx

View File

@@ -0,0 +1,64 @@
# DepthFirstScheduler(<28>[<5B><><EFBFBD>D<EFBFBD><44><EFBFBD>X<EFBFBD>P<EFBFBD>W<EFBFBD><57><EFBFBD>[<5B><><EFBFBD>[)
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>́AUnity5.6<EFBFBD><EFBFBD>Task<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƃ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>߂̃<EFBFBD><EFBFBD>C<EFBFBD>u<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ł<EFBFBD><EFBFBD>B
<EFBFBD>@<40>\<5C><><EFBFBD>Ƀ^<5E>X<EFBFBD>N<EFBFBD><4E><EFBFBD>g<EFBFBD>ݗ<EFBFBD><DD97>ĂāA<C481>[<5B><><EFBFBD>D<EFBFBD><44><EFBFBD>ŏ<EFBFBD><C58F><EFBFBD><EFBFBD><EFBFBD><EFBFBD>܂<EFBFBD><DC82>B
* <20>^<5E>X<EFBFBD>N<EFBFBD>̎<EFBFBD><CC8E>s<EFBFBD>X<EFBFBD>P<EFBFBD>W<EFBFBD><57><EFBFBD>[<5B><><EFBFBD>[(Unity<74><79><EFBFBD>C<EFBFBD><43><EFBFBD>X<EFBFBD><58><EFBFBD>b<EFBFBD>h<EFBFBD><EFBFBD>C<EFBFBD><43><EFBFBD>X<EFBFBD><58><EFBFBD>b<EFBFBD>h)<29><><EFBFBD>w<EFBFBD><77><EFBFBD>ł<EFBFBD><C582><EFBFBD>
# <20>g<EFBFBD><67><EFBFBD><EFBFBD>
```cs
var schedulable = new Schedulable<Unit>();
schedulable
.AddTask(Scheduler.ThreadPool, () => // <20>q<EFBFBD><71><EFBFBD>̃^<5E>X<EFBFBD>N<EFBFBD><4E><EFBFBD>lj<EFBFBD><C789><EFBFBD><EFBFBD><EFBFBD>
{
return glTF_VRM_Material.Parse(ctx.Json);
})
.ContinueWith(Scheduler.MainThread, gltfMaterials => // <20>Z<EFBFBD><5A><EFBFBD>̃^<5E>X<EFBFBD>N<EFBFBD><4E><EFBFBD>lj<EFBFBD><C789><EFBFBD><EFBFBD><EFBFBD>
{
ctx.MaterialImporter = new VRMMaterialImporter(ctx, gltfMaterials);
})
.Subscribe(Scheduler.MainThread, onLoaded, onError);
;
```
# Schedulable<T>
T<EFBFBD>^<5E>̌<EFBFBD><CC8C>ʂ<EFBFBD><CA82>Ԃ<EFBFBD><D482>^<5E>X<EFBFBD>N<EFBFBD>B
## AddTask(IScheduler scheduler, Func<T> firstTask)
<EFBFBD>q<EFBFBD><EFBFBD><EFBFBD>̃^<5E>X<EFBFBD>N<EFBFBD><4E><EFBFBD>lj<EFBFBD><C789><EFBFBD><EFBFBD><EFBFBD><EFBFBD>B
ToDo: <20><><EFBFBD>–ڂ̎q<CC8E><71><EFBFBD>Ɉ<EFBFBD><C988><EFBFBD><EFBFBD><EFBFBD><EFBFBD>n<EFBFBD><6E><EFBFBD><EFBFBD><EFBFBD>i<EFBFBD><69><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
## ContinueWith
## ContinueWithCoroutine
## OnExecute
<EFBFBD><EFBFBD><EFBFBD>I<EFBFBD>Ƀ^<5E>X<EFBFBD>N<EFBFBD><4E><EFBFBD>lj<EFBFBD><C789><EFBFBD><EFBFBD><EFBFBD>߂<EFBFBD>Hook<6F>B
<EFBFBD><EFBFBD><EFBFBD>ŁA
```
parent.AddTask
```
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƂŎ<EFBFBD><EFBFBD>s<EFBFBD><EFBFBD><EFBFBD>Ɏq<EFBFBD>^<5E>X<EFBFBD>N<EFBFBD><4E><EFBFBD>lj<EFBFBD><C789>ł<EFBFBD><C582><EFBFBD><EFBFBD>B
## Subscribe
<EFBFBD>^<5E>X<EFBFBD>N<EFBFBD>̎<EFBFBD><CC8E>s<EFBFBD><73><EFBFBD>J<EFBFBD>n<EFBFBD><6E><EFBFBD><EFBFBD><EFBFBD>B
<EFBFBD><EFBFBD><EFBFBD>s<EFBFBD><EFBFBD><EFBFBD>ʂ𓾂<EFBFBD><EFBFBD>B
# Scheduler
## StepScheduler
Unity
## CurrentThreadScheduler
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
## ThreadPoolScheduler
<EFBFBD>X<EFBFBD><EFBFBD><EFBFBD>b<EFBFBD>h
## ThreadScheduler
<EFBFBD>X<EFBFBD><EFBFBD><EFBFBD>b<EFBFBD>h

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 4ee74c03391cf2d459c264d956463550
timeCreated: 1533786689
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -5,7 +5,7 @@ using System.Collections.Generic;
using System.Threading.Tasks;
#endif
namespace UniTask
namespace DepthFirstScheduler
{
public interface ISchedulable
{

View File

@@ -1,6 +1,6 @@
using System;
namespace UniTask
namespace DepthFirstScheduler
{
public interface IScheduler : IDisposable
{

View File

@@ -2,7 +2,7 @@
using System.Collections;
using System.Collections.Generic;
namespace UniTask
namespace DepthFirstScheduler
{
public static partial class Scheduler
{

View File

@@ -1,4 +1,4 @@
namespace UniTask
namespace DepthFirstScheduler
{
public static partial class Scheduler
{

View File

@@ -1,6 +1,6 @@
using System;
namespace UniTask
namespace DepthFirstScheduler
{
public static partial class Scheduler
{

View File

@@ -1,7 +1,7 @@
using System;
using System.Threading;
namespace UniTask
namespace DepthFirstScheduler
{
public static partial class Scheduler
{

View File

@@ -3,7 +3,7 @@ using System.Linq;
using System.Collections.Generic;
namespace UniTask
namespace DepthFirstScheduler
{
public enum ChainStatus
{

View File

@@ -1,6 +1,6 @@
using System;
namespace UniTask
namespace DepthFirstScheduler
{
[Serializable]
public struct Unit : IEquatable<Unit>

View File

@@ -5,7 +5,7 @@ using UnityEngine;
using UniGLTF;
using System.Collections.Generic;
using System.Collections;
using UniTask;
using DepthFirstScheduler;
#if (NET_4_6 && UNITY_2017_1_OR_NEWER)
using System.Threading.Tasks;
#endif
@@ -414,17 +414,14 @@ namespace VRM
private static Schedulable<GameObject> LoadVrmAsyncInternal(VRMImporterContext ctx, bool show)
{
var schedulable = Schedulable.Create();
return schedulable
return Schedulable.Create()
.AddTask(Scheduler.ThreadPool, () =>
{
return glTF_VRM_Material.Parse(ctx.Json);
})
.ContinueWith(Scheduler.MainThread, x =>
.ContinueWith(Scheduler.MainThread, gltfMaterials =>
{
// material function
ctx.MaterialImporter = new VRMMaterialImporter(ctx, x);
ctx.MaterialImporter = new VRMMaterialImporter(ctx, gltfMaterials);
})
.OnExecute(Scheduler.ThreadPool, parent =>
{