Firstborn/Library/PackageCache/com.unity.addressables@1.19.19/Runtime/ResourceManager/AsyncOperations/DownloadStatus.cs
Schaken-Mods 7502018d20 Adding Mod Support
There is an asset in the store I grabbed. the coding is WAY above my head, I got about half of it and integrated and adapted what I can to it. im going as far as I can with it and ill come back in a few month when I understand t better.
2023-05-13 22:01:48 -05:00

33 lines
1.1 KiB
C#

using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine.ResourceManagement.ResourceLocations;
namespace UnityEngine.ResourceManagement.AsyncOperations
{
/// <summary>
/// Contains download information for async operations.
/// </summary>
public struct DownloadStatus
{
/// <summary>
/// The number of bytes downloaded by the operation and all of its dependencies.
/// </summary>
public long TotalBytes;
/// <summary>
/// The total number of bytes needed to download by the operation and dependencies.
/// </summary>
public long DownloadedBytes;
/// <summary>
/// Is the operation completed. This is used to determine if the computed Percent should be 0 or 1 when TotalBytes is 0.
/// </summary>
public bool IsDone;
/// <summary>
/// Returns the computed percent complete as a float value between 0 &amp; 1. If TotalBytes == 0, 1 is returned.
/// </summary>
public float Percent => (TotalBytes > 0) ? ((float)DownloadedBytes / (float)TotalBytes) : (IsDone ? 1.0f : 0f);
}
}