pull/73/head
neuecc 2020-05-07 15:17:29 +09:00
parent 5d0d29dffd
commit be45066773
5 changed files with 97 additions and 15 deletions

2
.gitignore vendored
View File

@ -156,4 +156,4 @@ src/UniTask/UniTask.Tests.csproj
src/UniTask/UniTask.Tests.Editor.csproj
src/UniTask/UniTask.unitypackage
src/UniTask/UniTask.*.unitypackage

View File

@ -12,14 +12,7 @@ public static class PackageExporter
public static void Export()
{
var root = "Plugins/UniTask";
var version = Environment.GetEnvironmentVariable("UNITY_PACKAGE_VERSION");
var versionJson = Path.Combine(Application.dataPath, root, "package.json");
if (File.Exists(versionJson))
{
var v = JsonUtility.FromJson<Version>(File.ReadAllText(versionJson));
version = v.version;
}
var version = GetVersion(root);
var fileName = string.IsNullOrEmpty(version) ? "UniTask.unitypackage" : $"UniTask.{version}.unitypackage";
var exportPath = "./" + fileName;
@ -40,6 +33,37 @@ public static class PackageExporter
UnityEngine.Debug.Log("Export complete: " + Path.GetFullPath(exportPath));
}
static string GetVersion(string root)
{
var version = Environment.GetEnvironmentVariable("UNITY_PACKAGE_VERSION");
var versionJson = Path.Combine(Application.dataPath, root, "package.json");
if (File.Exists(versionJson))
{
var v = JsonUtility.FromJson<Version>(File.ReadAllText(versionJson));
if (!string.IsNullOrEmpty(version))
{
if (v.version != version)
{
var msg = $"package.json and env version are mismatched. UNITY_PACKAGE_VERSION:{version}, package.json:{v.version}";
if (Application.isBatchMode)
{
Console.WriteLine(msg);
Application.Quit(1);
}
throw new Exception("package.json and env version are mismatched.");
}
}
version = v.version;
}
return version;
}
public class Version
{
public string version;

View File

@ -30,6 +30,11 @@ public struct MyJob : IJob
}
}
public enum MyEnum
{
A,B,C
}
public class SandboxMain : MonoBehaviour
{
public Button okButton;
@ -117,24 +122,30 @@ public class SandboxMain : MonoBehaviour
//StartCoroutine(cor);
Debug.Log(EqualityComparer<MyEnum>.Default.GetType().FullName);
//this.TryGetComponent(
CancellationTokenSource cts = new CancellationTokenSource();
var trigger = this.GetAsyncUpdateTrigger();
Go(trigger, 1, cts.Token).Forget();
Go(trigger, 2, cts.Token).Forget();
Go(trigger, 3, cts.Token).Forget();
Go(trigger, 4, cts.Token).Forget();
Go(trigger, 5, cts.Token).Forget();
//var trigger = this.GetAsyncUpdateTrigger();
//Go(trigger, 1, cts.Token).Forget();
//Go(trigger, 2, cts.Token).Forget();
//Go(trigger, 3, cts.Token).Forget();
//Go(trigger, 4, cts.Token).Forget();
//Go(trigger, 5, cts.Token).Forget();
Application.logMessageReceived += Application_logMessageReceived;
UniTask<int> foo = UniTask.FromResult(10);
// foo.Status.IsCanceled
Foo(foo);
//ucs = new UniTaskCompletionSource();

View File

@ -0,0 +1,47 @@
{
"dependencies": {
"com.unity.addressables": "1.8.3",
"com.unity.ads": "2.0.8",
"com.unity.analytics": "3.3.5",
"com.unity.collab-proxy": "1.2.16",
"com.unity.ext.nunit": "1.0.0",
"com.unity.ide.rider": "1.1.4",
"com.unity.ide.visualstudio": "1.0.5",
"com.unity.ide.vscode": "1.1.4",
"com.unity.purchasing": "2.0.6",
"com.unity.test-framework": "1.1.13",
"com.unity.textmeshpro": "2.0.1",
"com.unity.timeline": "1.2.6",
"com.unity.modules.ai": "1.0.0",
"com.unity.modules.androidjni": "1.0.0",
"com.unity.modules.animation": "1.0.0",
"com.unity.modules.assetbundle": "1.0.0",
"com.unity.modules.audio": "1.0.0",
"com.unity.modules.cloth": "1.0.0",
"com.unity.modules.director": "1.0.0",
"com.unity.modules.imageconversion": "1.0.0",
"com.unity.modules.imgui": "1.0.0",
"com.unity.modules.jsonserialize": "1.0.0",
"com.unity.modules.particlesystem": "1.0.0",
"com.unity.modules.physics": "1.0.0",
"com.unity.modules.physics2d": "1.0.0",
"com.unity.modules.screencapture": "1.0.0",
"com.unity.modules.terrain": "1.0.0",
"com.unity.modules.terrainphysics": "1.0.0",
"com.unity.modules.tilemap": "1.0.0",
"com.unity.modules.ui": "1.0.0",
"com.unity.modules.uielements": "1.0.0",
"com.unity.modules.umbra": "1.0.0",
"com.unity.modules.unityanalytics": "1.0.0",
"com.unity.modules.unitywebrequest": "1.0.0",
"com.unity.modules.unitywebrequestassetbundle": "1.0.0",
"com.unity.modules.unitywebrequestaudio": "1.0.0",
"com.unity.modules.unitywebrequesttexture": "1.0.0",
"com.unity.modules.unitywebrequestwww": "1.0.0",
"com.unity.modules.vehicles": "1.0.0",
"com.unity.modules.video": "1.0.0",
"com.unity.modules.vr": "1.0.0",
"com.unity.modules.wind": "1.0.0",
"com.unity.modules.xr": "1.0.0"
}
}