using System;
namespace UnityEditor.Build.Pipeline.Interfaces
{
///
/// Base interface for all objects that can be stored in .
///
public interface IContextObject {}
///
/// Base interface that handles processing the callbacks after script building step.
///
public interface IScriptsCallback : IContextObject
{
///
/// Processes all the callbacks after script building step.
///
/// Parameters passed into the build pipeline.
/// Results from the script building step.
/// Return code from processing the callbacks.
ReturnCode PostScripts(IBuildParameters parameters, IBuildResults results);
}
///
/// Base interface for handling running the callbacks after dependency calculation step.
///
public interface IDependencyCallback : IContextObject
{
///
/// Processes all the callbacks after dependency calculation step.
///
/// Parameters passed into the build pipeline.
/// Results from the dependency calculation step.
/// Return code from processing the callbacks.
ReturnCode PostDependency(IBuildParameters parameters, IDependencyData dependencyData);
}
///
/// Base interface for handling running the callbacks after packing step.
///
public interface IPackingCallback : IContextObject
{
///
/// Processes all the callbacks after packing step.
///
/// Parameters passed into the build pipeline.
/// Results from the dependency calculation step.
/// Results from the packing step.
/// Return code from processing the callbacks.
ReturnCode PostPacking(IBuildParameters parameters, IDependencyData dependencyData, IWriteData writeData);
}
///
/// Base interface for handling running the callbacks after writing step.
///
public interface IWritingCallback : IContextObject
{
///
/// Processes all the callbacks after writing step.
///
/// Parameters passed into the build pipeline.
/// Results from the dependency calculation step.
/// Results from the packing step.
/// Results from the writing step.
/// Return code from processing the callbacks.
ReturnCode PostWriting(IBuildParameters parameters, IDependencyData dependencyData, IWriteData writeData, IBuildResults results);
}
///
/// Base interface for build data container system
///
public interface IBuildContext
{
///
/// Checks the build context for existence of a data that is of the specified type.
///
/// Type of data to check for existence.
/// true if the context contains specified type of data; otherwise, false.
bool ContainsContextObject() where T : IContextObject;
///
/// Checks the build context for existence of a data that is of the specified type.
///
/// Type of data to check for existence.
/// true if the context contains specified type of data; otherwise, false.
bool ContainsContextObject(Type type);
///
/// Gets the data of the specified type contained in the build context.
///
/// Type of data to return.
/// The type of data specified.
T GetContextObject() where T : IContextObject;
///
/// Gets the data of the specified type contained in the build context.
///
/// Type of data to return.
/// The type of data specified.
IContextObject GetContextObject(Type type);
///
/// Adds the data of the specified type to the build context.
///
/// Type of data to add.
/// Object holding the data to add.
void SetContextObject(IContextObject contextObject) where T : IContextObject;
///
/// Adds the data of the specified type to the build context.
///
/// Type of data to add.
/// Object holding the data to add.
void SetContextObject(Type type, IContextObject contextObject);
///
/// Adds the data to the build context. Type will be inferred using Reflection.
///
/// Object holding the data to add.
void SetContextObject(IContextObject contextObject);
///
/// Tries to get the data of the specified type contained in the build context.
///
/// Type of data to return.
/// The object holding the data to be returned if found.
/// true if the context was able to returned the specified data; otherwise, false.
bool TryGetContextObject(out T contextObject) where T : IContextObject;
///
/// Tries to get the data of the specified type contained in the build context.
///
/// Type of data to return.
/// The object holding the data to be returned if found.
/// true if the context was able to returned the specified data; otherwise, false.
bool TryGetContextObject(Type type, out IContextObject contextObject);
}
}