Skip to content

Commit 10d195b

Browse files
committed
Added export script for building packaged files
1 parent 9bf4a15 commit 10d195b

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
using System.Collections.Generic;
2+
using System.Linq;
3+
using UnityEditor;
4+
5+
namespace Adnc.FluidBT.Editor {
6+
public class ExportProject {
7+
[MenuItem("Export/Fluid Behavior Tree")]
8+
static void BuildProject () {
9+
var core = GetCoreFiles();
10+
var examples = GetExampleFiles();
11+
var path = EditorUtility.OpenFolderPanel("Select Output Location", "", "");
12+
13+
AssetDatabase.ExportPackage(core.ToArray(), $"{path}/Fluid Behavior Tree.unitypackage");
14+
AssetDatabase.ExportPackage(examples.ToArray(), $"{path}/Fluid Behavior Tree - Examples.unitypackage");
15+
}
16+
17+
private static List<string> GetCoreFiles () {
18+
return AssetDatabase
19+
.FindAssets("", new[] {"Assets/FluidBehaviorTree"}).ToList()
20+
.Select(AssetDatabase.GUIDToAssetPath)
21+
.Where(file => {
22+
var invalidFolder = file.Contains("Assets/FluidBehaviorTree/Editor") ||
23+
file.Contains("Assets/FluidBehaviorTree/Examples");
24+
25+
if (invalidFolder) return false;
26+
27+
return !file.Contains("Test.cs");
28+
}).ToList();
29+
}
30+
31+
private static List<string> GetExampleFiles () {
32+
return AssetDatabase
33+
.FindAssets("", new[] {"Assets/FluidBehaviorTree/Examples"}).ToList()
34+
.Select(AssetDatabase.GUIDToAssetPath).ToList();
35+
}
36+
}
37+
}

Assets/FluidBehaviorTree/Editor/ExportProject.cs.meta

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)