Skip to content

Commit

Permalink
Merge pull request #20 from MystikalPooka/BugFix/EditorWindows
Browse files Browse the repository at this point in the history
Bug fix/editor windows
  • Loading branch information
MystikalPooka committed Dec 1, 2018
2 parents 8f71200 + 46f2670 commit b7562c7
Show file tree
Hide file tree
Showing 106 changed files with 3,896 additions and 1,591 deletions.
36 changes: 36 additions & 0 deletions Assets/Plugins/UniRx/Scripts/Async/EnumerableAsyncExtensions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6))
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member

using System;
using System.Collections.Generic;

namespace UniRx.Async
{
public static class EnumerableAsyncExtensions
{
// overload resolver - .Select(async x => { }) : IEnumerable<UniTask<T>>

public static IEnumerable<UniTask> Select<T>(this IEnumerable<T> source, Func<T, UniTask> selector)
{
return System.Linq.Enumerable.Select(source, selector);
}

public static IEnumerable<UniTask<TR>> Select<T, TR>(this IEnumerable<T> source, Func<T, UniTask<TR>> selector)
{
return System.Linq.Enumerable.Select(source, selector);
}

public static IEnumerable<UniTask> Select<T>(this IEnumerable<T> source, Func<T, int, UniTask> selector)
{
return System.Linq.Enumerable.Select(source, selector);
}

public static IEnumerable<UniTask<TR>> Select<T, TR>(this IEnumerable<T> source, Func<T, int, UniTask<TR>> selector)
{
return System.Linq.Enumerable.Select(source, selector);
}
}
}


#endif

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 34 additions & 0 deletions Assets/Plugins/UniRx/Scripts/Async/Internal/PromiseHelper.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6))
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member

using System.Collections.Generic;

namespace UniRx.Async.Internal
{
public static class PromiseHelper
{
public static void TrySetResultAll<TPromise, T>(IEnumerable<TPromise> source, T value)
where TPromise : class, IResolvePromise<T>
{
var rentArray = ArrayPoolUtil.Materialize(source);
var clearArray = true;
try
{
var array = rentArray.Array;
var len = rentArray.Length;
for (int i = 0; i < len; i++)
{
array[i].TrySetResult(value);
array[i] = null;
}
clearArray = false;
}
finally
{
rentArray.DisposeManually(clearArray);
}
}
}
}

#endif
11 changes: 11 additions & 0 deletions Assets/Plugins/UniRx/Scripts/Async/Internal/PromiseHelper.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit b7562c7

Please sign in to comment.