mirror of
https://github.com/tuyoogame/YooAsset.git
synced 2026-05-15 20:20:08 +00:00
61 lines
1.0 KiB
C#
61 lines
1.0 KiB
C#
|
|
namespace YooAsset
|
|
{
|
|
internal class BundledRawFileProvider : BundledProvider
|
|
{
|
|
public override float Progress
|
|
{
|
|
get
|
|
{
|
|
if (IsDone)
|
|
return 1f;
|
|
else
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
public BundledRawFileProvider(AssetSystemImpl impl, string providerGUID, AssetInfo assetInfo) : base(impl, providerGUID, assetInfo)
|
|
{
|
|
}
|
|
public override void Update()
|
|
{
|
|
DebugRecording();
|
|
|
|
if (IsDone)
|
|
return;
|
|
|
|
if (Status == EStatus.None)
|
|
{
|
|
Status = EStatus.CheckBundle;
|
|
}
|
|
|
|
if (Status == EStatus.CheckBundle)
|
|
{
|
|
if (IsWaitForAsyncComplete)
|
|
{
|
|
OwnerBundle.WaitForAsyncComplete();
|
|
}
|
|
|
|
if (OwnerBundle.IsDone() == false)
|
|
return;
|
|
|
|
if (OwnerBundle.Status != BundleLoaderBase.EStatus.Succeed)
|
|
{
|
|
Status = EStatus.Failed;
|
|
LastError = OwnerBundle.LastError;
|
|
InvokeCompletion();
|
|
return;
|
|
}
|
|
|
|
Status = EStatus.Checking;
|
|
}
|
|
|
|
if (Status == EStatus.Checking)
|
|
{
|
|
RawFilePath = OwnerBundle.FileLoadPath;
|
|
Status = EStatus.Succeed;
|
|
InvokeCompletion();
|
|
}
|
|
}
|
|
}
|
|
} |