Packaging Update
# Added - Added LICENCE. - Added build workflow. - Added release workflow. - Added PackageTools. # Changed - Update Unity from 2020.3.1f1 to 2020.8.1f1.
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5bddc361c940411409071c6fcf515202
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: dcc1148481889924d91760737bcc6516
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,56 @@
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
namespace MackySoft.PackageTools.Editor {
|
||||
|
||||
public static class UnityPackageExporter {
|
||||
|
||||
// The name of the unitypackage to output.
|
||||
const string k_PackageName = "SerializeReference-Extensions";
|
||||
|
||||
// The path to the package under the `Assets/` folder.
|
||||
const string k_PackagePath = "MackySoft";
|
||||
|
||||
// Path to export to.
|
||||
const string k_ExportPath = "Build";
|
||||
|
||||
const string k_SearchPattern = "*";
|
||||
const string k_PackageToolsFolderName = "PackageTools";
|
||||
const string k_ResourcesFolderName = "Resources";
|
||||
|
||||
[MenuItem("Tools/SerializeReference Extensions/Export Package")]
|
||||
public static void Export () {
|
||||
ExportPackage($"{k_ExportPath}/{k_PackageName}.unitypackage");
|
||||
}
|
||||
|
||||
|
||||
public static string ExportPackage (string exportPath) {
|
||||
// Ensure export path.
|
||||
var dir = new FileInfo(exportPath).Directory;
|
||||
if (dir != null && !dir.Exists) {
|
||||
dir.Create();
|
||||
}
|
||||
|
||||
// Export
|
||||
AssetDatabase.ExportPackage(
|
||||
GetAssetPaths(),
|
||||
exportPath,
|
||||
ExportPackageOptions.Default
|
||||
);
|
||||
|
||||
return Path.GetFullPath(exportPath);
|
||||
}
|
||||
|
||||
public static string[] GetAssetPaths () {
|
||||
var path = Path.Combine(Application.dataPath,k_PackagePath);
|
||||
var assets = Directory.EnumerateFiles(path,k_SearchPattern,SearchOption.AllDirectories)
|
||||
.Where(x => !x.Contains(k_PackageToolsFolderName) && !x.Contains(k_ResourcesFolderName))
|
||||
.Select(x => "Assets" + x.Replace(Application.dataPath,"").Replace(@"\","/"))
|
||||
.ToArray();
|
||||
return assets;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 18e0101a13bd4d541a4622e86ec18b4e
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user