using UnityEditor;
using System;
namespace AssetBundleBrowser.AssetBundleDataSource
{
///
/// Build Info struct used by ABDataSource to pass needed build data around.
///
public partial class ABBuildInfo
{
///
/// Directory to place build result
///
public string outputDirectory
{
get { return m_outputDirectory; }
set { m_outputDirectory = value; }
}
private string m_outputDirectory;
///
/// Standard asset bundle build options.
///
public BuildAssetBundleOptions options
{
get { return m_options; }
set { m_options = value; }
}
private BuildAssetBundleOptions m_options;
///
/// Target platform for build.
///
public BuildTarget buildTarget
{
get { return m_buildTarget; }
set { m_buildTarget = value; }
}
private BuildTarget m_buildTarget;
///
/// Callback for build event.
///
public Action onBuild
{
get { return m_onBuild; }
set { m_onBuild = value; }
}
private Action m_onBuild;
}
///
/// Interface class used by browser. It is expected to contain all information needed to display predicted bundle layout.
/// Any class deriving from this interface AND implementing CreateDataSources() will be picked up by the browser automatically
/// and displayed in an in-tool dropdown. By default, that dropdown is hidden if the browser detects no external data sources.
/// To turn it on, right click on tab header "AssetBundles" and enable "Custom Sources"
///
/// Must implement CreateDataSources() to be picked up by the browser.
/// public static List CreateDataSources();
///
///
public partial interface ABDataSource
{
//// all derived classes must implement the following interface in order to be picked up by the browser.
//public static List CreateDataSources();
///
/// Name of DataSource. Displayed in menu as "Name (ProvidorName)"
///
string Name { get; }
///
/// Name of provider for DataSource. Displayed in menu as "Name (ProvidorName)"
///
string ProviderName { get; }
///
/// Array of paths in bundle.
///
string[] GetAssetPathsFromAssetBundle (string assetBundleName);
///
/// Name of bundle explicitly associated with asset at path.
///
string GetAssetBundleName(string assetPath);
///
/// Name of bundle associated with asset at path.
/// The difference between this and GetAssetBundleName() is for assets unassigned to a bundle, but
/// residing inside a folder that is assigned to a bundle. Those assets will implicitly associate
/// with the bundle associated with the parent folder.
///
string GetImplicitAssetBundleName(string assetPath);
///
/// Array of asset bundle names in project
///
string[] GetAllAssetBundleNames();
///
/// If this data source is read only.
/// If this returns true, much of the Browsers's interface will be disabled (drag&drop, etc.)
///
bool IsReadOnly();
///
/// Sets the asset bundle name (and variant) on a given asset
///
void SetAssetBundleNameAndVariant (string assetPath, string bundleName, string variantName);
///
/// Clears out any asset bundle names that do not have assets associated with them.
///
void RemoveUnusedAssetBundleNames();
///
/// Signals if this data source can have build target set by tool
///
bool CanSpecifyBuildTarget { get; }
///
/// Signals if this data source can have output directory set by tool
///
bool CanSpecifyBuildOutputDirectory { get; }
///
/// Signals if this data source can have build options set by tool
///
bool CanSpecifyBuildOptions { get; }
///
/// Executes data source's implementation of asset bundle building.
/// Called by "build" button in build tab of tool.
///
bool BuildAssetBundles (ABBuildInfo info);
}
}