using System; namespace Unity.Play.Publisher.Editor { /// /// Represents the state of the App /// [Serializable] public class AppState { /// /// Initializes and returns an instance of AppState /// /// /// /// /// /// /// /// /// public AppState( string title = null, string buildOutputDir = null, string buildGUID = null, string zipPath = null, PublisherState step = default, string errorMsg = null, string key = null, string url = null) { this.title = title; this.buildOutputDir = buildOutputDir; this.buildGUID = buildGUID; this.zipPath = zipPath; this.step = step; this.errorMsg = errorMsg; this.url = url; this.key = key; } /// /// Copies the state of the app, applying changes /// /// /// /// /// /// /// /// /// /// public AppState CopyWith( string title = null, string buildOutputDir = null, string buildGUID = null, string zipPath = null, PublisherState? step = default, string errorMsg = null, string key = null, string url = null) { return new AppState( title: title ?? this.title, buildOutputDir: buildOutputDir ?? this.buildOutputDir, buildGUID: buildGUID ?? this.buildGUID, zipPath: zipPath ?? this.zipPath, step: step ?? this.step, errorMsg: errorMsg ?? this.errorMsg, key: key ?? this.key, url: url ?? this.url ); } /// /// The title of the build /// public string title; /// /// The output directory of the build /// public string buildOutputDir; /// /// GUID of the build /// public string buildGUID; /// /// The path of the most recent zipped build /// public string zipPath; /// /// The current step fo the App /// public PublisherState step; /// /// the key that identifies this build process /// public string key; /// /// Latest error message /// public string errorMsg; /// /// The URL of the uploaded build /// public string url; } /// /// Options for identifying the state of the app /// public enum PublisherState { /// /// The app is not doing anything /// Idle, /// /// The user needs to login /// Login, /// /// A build is being zipped /// Zip, /// /// A build is being uploaded /// Upload, /// /// An uploaded build is being processed /// Process } }