initial commit
This commit is contained in:
parent
6715289efe
commit
788c3389af
37645 changed files with 2526849 additions and 80 deletions
|
@ -0,0 +1,13 @@
|
|||
using System.Runtime.CompilerServices;
|
||||
|
||||
[assembly: InternalsVisibleTo("Unity.Services.Core.Registration")]
|
||||
[assembly: InternalsVisibleTo("Unity.Services.Core.TestUtils")]
|
||||
|
||||
// Test assemblies
|
||||
#if UNITY_INCLUDE_TESTS
|
||||
[assembly: InternalsVisibleTo("Unity.Services.Core.Tests")]
|
||||
[assembly: InternalsVisibleTo("Unity.Services.Core.EditorTests")]
|
||||
[assembly: InternalsVisibleTo("Unity.Services.Core.TestUtils.Tests")]
|
||||
[assembly: InternalsVisibleTo("Unity.Services.Core.TestUtils.EditorTests")]
|
||||
[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2")]
|
||||
#endif
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: b8e559f165188eb45956491215ec4108
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,3 @@
|
|||
// This file is generated. Do not modify by hand.
|
||||
// XML documentation file not found. To check if public methods have XML comments,
|
||||
// make sure the XML doc file is present and located next to the scraped dll
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: a2223fccbc4b76546b70cd6d62739cf1
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
"name": "Unity.Services.Core.Threading",
|
||||
"references": [
|
||||
"Unity.Services.Core",
|
||||
"Unity.Services.Core.Internal"
|
||||
],
|
||||
"includePlatforms": [],
|
||||
"excludePlatforms": [],
|
||||
"allowUnsafeCode": false,
|
||||
"overrideReferences": false,
|
||||
"precompiledReferences": [],
|
||||
"autoReferenced": false,
|
||||
"defineConstraints": [],
|
||||
"versionDefines": [],
|
||||
"noEngineReferences": false
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 424c109c039b23a469d7e72a2a76e122
|
||||
AssemblyDefinitionImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,91 @@
|
|||
using System;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Unity.Services.Core.Threading.Internal
|
||||
{
|
||||
class UnityThreadUtilsInternal : IUnityThreadUtils
|
||||
{
|
||||
public static Task PostAsync(Action action)
|
||||
{
|
||||
return Task.Factory.StartNew(
|
||||
action, CancellationToken.None, TaskCreationOptions.None, UnityThreadUtils.UnityThreadScheduler);
|
||||
}
|
||||
|
||||
public static Task PostAsync(Action<object> action, object state)
|
||||
{
|
||||
return Task.Factory.StartNew(
|
||||
action, state, CancellationToken.None, TaskCreationOptions.None,
|
||||
UnityThreadUtils.UnityThreadScheduler);
|
||||
}
|
||||
|
||||
public static Task<T> PostAsync<T>(Func<T> action)
|
||||
{
|
||||
return Task<T>.Factory.StartNew(
|
||||
action, CancellationToken.None, TaskCreationOptions.None, UnityThreadUtils.UnityThreadScheduler);
|
||||
}
|
||||
|
||||
public static Task<T> PostAsync<T>(Func<object, T> action, object state)
|
||||
{
|
||||
return Task<T>.Factory.StartNew(
|
||||
action, state, CancellationToken.None, TaskCreationOptions.None,
|
||||
UnityThreadUtils.UnityThreadScheduler);
|
||||
}
|
||||
|
||||
public static void Send(Action action)
|
||||
{
|
||||
if (UnityThreadUtils.IsRunningOnUnityThread)
|
||||
{
|
||||
action();
|
||||
return;
|
||||
}
|
||||
|
||||
PostAsync(action).Wait();
|
||||
}
|
||||
|
||||
public static void Send(Action<object> action, object state)
|
||||
{
|
||||
if (UnityThreadUtils.IsRunningOnUnityThread)
|
||||
{
|
||||
action(state);
|
||||
return;
|
||||
}
|
||||
|
||||
PostAsync(action, state).Wait();
|
||||
}
|
||||
|
||||
public static T Send<T>(Func<T> action)
|
||||
{
|
||||
if (UnityThreadUtils.IsRunningOnUnityThread)
|
||||
{
|
||||
return action();
|
||||
}
|
||||
|
||||
var task = PostAsync(action);
|
||||
task.Wait();
|
||||
return task.Result;
|
||||
}
|
||||
|
||||
public static T Send<T>(Func<object, T> action, object state)
|
||||
{
|
||||
if (UnityThreadUtils.IsRunningOnUnityThread)
|
||||
{
|
||||
return action(state);
|
||||
}
|
||||
|
||||
var task = PostAsync(action, state);
|
||||
task.Wait();
|
||||
return task.Result;
|
||||
}
|
||||
|
||||
bool IUnityThreadUtils.IsRunningOnUnityThread => UnityThreadUtils.IsRunningOnUnityThread;
|
||||
Task IUnityThreadUtils.PostAsync(Action action) => PostAsync(action);
|
||||
Task IUnityThreadUtils.PostAsync(Action<object> action, object state) => PostAsync(action, state);
|
||||
Task<T> IUnityThreadUtils.PostAsync<T>(Func<T> action) => PostAsync(action);
|
||||
Task<T> IUnityThreadUtils.PostAsync<T>(Func<object, T> action, object state) => PostAsync(action, state);
|
||||
void IUnityThreadUtils.Send(Action action) => Send(action);
|
||||
void IUnityThreadUtils.Send(Action<object> action, object state) => Send(action, state);
|
||||
T IUnityThreadUtils.Send<T>(Func<T> action) => Send(action);
|
||||
T IUnityThreadUtils.Send<T>(Func<object, T> action, object state) => Send(action, state);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: a232b29fae442f345b7a6b4f9b9f44ae
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Loading…
Add table
Add a link
Reference in a new issue