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