Support composite sharing payloads (multiple images, multiple videos, and so on) instead of restricting to one image or one video or one piece of text
Finally take care of #44
A more object-oriented front-end. This has been a recent trend across all the Nat* API's; NatCam, NatCorder, and NatMic have all moved away from the static class pattern to functional instances.
Here's a draft:
namespace NatShare { // No more `NatShareU`
public class SharePayload : IDisposable? { // Does this need to be disposable?
/// <summary>
/// Subject of the share payload
/// </summary>
public string Subject { get; set; }
/// <summary>
/// Add plain text
/// </summary>
public void AddText (string text);
/// <summary>
/// Add an image
/// </summary>
public void AddImage (Texture2D image);
/// <summary>
/// Add media with at a given URI
/// </summary>
public void AddMedia (string uri);
/// <summary>
/// Commit the payload to the operating system for sharing
/// </summary>
public void Commit (Action completionHandler = null);
/// <summary>
/// Dispose the payload
/// </summary>
public void Dispose ();
}
public class MediaPayload : IDisposable {
/// <summary>
/// Create a media payload for a given image
/// </summary>
public MediaPayload (Texture2D image);
/// <summary>
/// Create a media payload for media at a given URI
/// </summary>
public MediaPayload (string uri);
/// <summary>
/// Get an image from the backing media
/// </summary>
public Texture2D GetImage (float time = 0f);
/// <summary>
/// Save the media to the camera roll
/// </summary>
public void SaveToCameraRoll (string album = null);
/// <summary>
/// Dispose the media payload
/// </summary>
public void Dispose ();
}
}
The goals of this will be:
Here's a draft: