mirror of
https://github.com/Cysharp/UniTask.git
synced 2026-05-19 21:50:08 +00:00
plus package
This commit is contained in:
35
Assets/Editor/PackageExporter.cs
Normal file
35
Assets/Editor/PackageExporter.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
#if UNITY_EDITOR
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
public static class PackageExporter
|
||||
{
|
||||
[MenuItem("Tools/Export Unitypackage")]
|
||||
public static void Export()
|
||||
{
|
||||
// configure
|
||||
var root = "UniRx.Async";
|
||||
var exportPath = "./UniRx.Async.unitypackage";
|
||||
|
||||
var path = Path.Combine(Application.dataPath, root);
|
||||
var assets = Directory.EnumerateFiles(path, "*", SearchOption.AllDirectories)
|
||||
.Where(x => Path.GetExtension(x) == ".cs" || Path.GetExtension(x) == ".asmdef" || Path.GetExtension(x) == ".json")
|
||||
.Select(x => "Assets" + x.Replace(Application.dataPath, "").Replace(@"\", "/"))
|
||||
.ToArray();
|
||||
|
||||
UnityEngine.Debug.Log("Export below files" + Environment.NewLine + string.Join(Environment.NewLine, assets));
|
||||
|
||||
AssetDatabase.ExportPackage(
|
||||
assets,
|
||||
exportPath,
|
||||
ExportPackageOptions.Default);
|
||||
|
||||
UnityEngine.Debug.Log("Export complete: " + Path.GetFullPath(exportPath));
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
11
Assets/Editor/PackageExporter.cs.meta
Normal file
11
Assets/Editor/PackageExporter.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: af97405af79afbb4e9f7f49f30088474
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user