-
-
Notifications
You must be signed in to change notification settings - Fork 12
How to Create a new Destination
James Veugelaers edited this page May 6, 2025
·
3 revisions
A destination is what is used to take a folder and upload it to a a local path or online service. A destination executes after all files have been saved to a temporary location (cache) and modified using modifiers.
The Build Uploader uses reflection to find all classes inheriting from ABuildDestination after compilation to show them in the dropdown. BuildDestinationAttribute is used to define static information about the destination such as what to display in the dropdown of the UI
using System.Collections.Generic;
using System.Threading.Tasks;
using Wireframe;
[BuildDestination("Custom Destination")]
public class CustomDestination : ABuildDestination
{
public override Task<bool> Upload(BuildTaskReport.StepResult stepResult)
{
// Implement the upload logic here
// For now, just return true to indicate success
return Task.FromResult(true);
}
public override string ProgressTitle()
{
// Return a title for the upload progress (WIP)
return "Uploading to Custom Destination";
}
public override bool IsSetup(out string reason)
{
// Check if the destination is set up correctly to avoid starting a build when not ready.
reason = string.Empty;
return true;
}
public override Dictionary<string, object> Serialize()
{
// Serialize the destination data into a dictionary
Dictionary<string, object> data = new Dictionary<string, object>();
// Add any necessary fields to the dictionary
return data;
}
public override void Deserialize(Dictionary<string, object> data)
{
// Deserialize the destination data from a dictionary
// Extract any necessary fields from the dictionary
}
protected override void OnGUICollapsed(ref bool isDirty, float maxWidth)
{
// Draw a 1 line representation of your destination
// Set isDirty to true to indicate it needs saving
}
protected override void OnGUIExpanded(ref bool isDirty)
{
// Draw all details of your destination here
// Set isDirty to true to indicate it needs saving
}
}