using UniFramework.Event;
using YooAsset;
public class PatchEventDefine
{
///
/// 补丁包初始化失败
///
public class InitializeFailed : IEventMessage
{
public static void SendEventMessage()
{
var msg = new InitializeFailed();
UniEvent.SendMessage(msg);
}
}
///
/// 补丁流程步骤改变
///
public class PatchStepsChange : IEventMessage
{
public string Tips;
public static void SendEventMessage(string tips)
{
var msg = new PatchStepsChange();
msg.Tips = tips;
UniEvent.SendMessage(msg);
}
}
///
/// 发现更新文件
///
public class FoundUpdateFiles : IEventMessage
{
public int TotalCount;
public long TotalSizeBytes;
public static void SendEventMessage(int totalCount, long totalSizeBytes)
{
var msg = new FoundUpdateFiles();
msg.TotalCount = totalCount;
msg.TotalSizeBytes = totalSizeBytes;
UniEvent.SendMessage(msg);
}
}
///
/// 下载进度更新
///
public class DownloadUpdate : IEventMessage
{
public int TotalDownloadCount;
public int CurrentDownloadCount;
public long TotalDownloadSizeBytes;
public long CurrentDownloadSizeBytes;
public static void SendEventMessage(DownloadUpdateData updateData)
{
var msg = new DownloadUpdate();
msg.TotalDownloadCount = updateData.TotalDownloadCount;
msg.CurrentDownloadCount = updateData.CurrentDownloadCount;
msg.TotalDownloadSizeBytes = updateData.TotalDownloadBytes;
msg.CurrentDownloadSizeBytes = updateData.CurrentDownloadBytes;
UniEvent.SendMessage(msg);
}
}
///
/// 资源版本请求失败
///
public class PackageVersionRequestFailed : IEventMessage
{
public static void SendEventMessage()
{
var msg = new PackageVersionRequestFailed();
UniEvent.SendMessage(msg);
}
}
///
/// 资源清单更新失败
///
public class PackageManifestUpdateFailed : IEventMessage
{
public static void SendEventMessage()
{
var msg = new PackageManifestUpdateFailed();
UniEvent.SendMessage(msg);
}
}
///
/// 网络文件下载失败
///
public class WebFileDownloadFailed : IEventMessage
{
public string FileName;
public string Error;
public static void SendEventMessage(DownloadErrorData errorData)
{
var msg = new WebFileDownloadFailed();
msg.FileName = errorData.FileName;
msg.Error = errorData.ErrorInfo;
UniEvent.SendMessage(msg);
}
}
}