modular-avatar/Assets/_ModularAvatar/EditModeTests/BuildAssetBundle.cs
2023-09-26 19:55:39 +09:00

28 lines
795 B
C#

using NUnit.Framework;
using UnityEditor;
namespace _ModularAvatar.EditModeTests
{
/// <summary>
/// This tests compilation error in runtime build with building asset bundle.
/// </summary>
public class BuildAssetBundle
{
[Test]
public void Build()
{
var path = "Packages/nadena.dev.modular-avatar/Assets/FixedPrefab.prefab";
var assetBundleBuild = new AssetBundleBuild()
{
assetNames = new string[]{ path },
assetBundleName = "asset.unity3d"
};
BuildPipeline.BuildAssetBundles("Assets/",
new [] {assetBundleBuild},
BuildAssetBundleOptions.None,
EditorUserBuildSettings.activeBuildTarget);
}
}
}