mirror of https://github.com/tuyoogame/YooAsset
parent
e3fc3df32c
commit
d55db19f0e
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 879f2b393f883554899ab3345f0dc998
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,68 @@
|
|||
#if UNITY_WEBGL && DOUYINMINIGAME
|
||||
using System.IO;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
using TTSDK;
|
||||
|
||||
namespace YooAsset
|
||||
{
|
||||
internal class TTAssetBundleResult : BundleResult
|
||||
{
|
||||
private readonly IFileSystem _fileSystem;
|
||||
private readonly PackageBundle _packageBundle;
|
||||
private readonly AssetBundle _assetBundle;
|
||||
|
||||
public TTAssetBundleResult(IFileSystem fileSystem, PackageBundle packageBundle, AssetBundle assetBundle)
|
||||
{
|
||||
_fileSystem = fileSystem;
|
||||
_packageBundle = packageBundle;
|
||||
_assetBundle = assetBundle;
|
||||
}
|
||||
|
||||
public override void UnloadBundleFile()
|
||||
{
|
||||
if (_assetBundle != null)
|
||||
{
|
||||
_assetBundle.TTUnload(true);
|
||||
}
|
||||
}
|
||||
public override string GetBundleFilePath()
|
||||
{
|
||||
return _fileSystem.GetBundleFilePath(_packageBundle);
|
||||
}
|
||||
public override byte[] ReadBundleFileData()
|
||||
{
|
||||
return _fileSystem.ReadBundleFileData(_packageBundle);
|
||||
}
|
||||
public override string ReadBundleFileText()
|
||||
{
|
||||
return _fileSystem.ReadBundleFileText(_packageBundle);
|
||||
}
|
||||
|
||||
public override FSLoadAssetOperation LoadAssetAsync(AssetInfo assetInfo)
|
||||
{
|
||||
var operation = new AssetBundleLoadAssetOperation(_packageBundle, _assetBundle, assetInfo);
|
||||
OperationSystem.StartOperation(_fileSystem.PackageName, operation);
|
||||
return operation;
|
||||
}
|
||||
public override FSLoadAllAssetsOperation LoadAllAssetsAsync(AssetInfo assetInfo)
|
||||
{
|
||||
var operation = new AssetBundleLoadAllAssetsOperation(_packageBundle, _assetBundle, assetInfo);
|
||||
OperationSystem.StartOperation(_fileSystem.PackageName, operation);
|
||||
return operation;
|
||||
}
|
||||
public override FSLoadSubAssetsOperation LoadSubAssetsAsync(AssetInfo assetInfo)
|
||||
{
|
||||
var operation = new AssetBundleLoadSubAssetsOperation(_packageBundle, _assetBundle, assetInfo);
|
||||
OperationSystem.StartOperation(_fileSystem.PackageName, operation);
|
||||
return operation;
|
||||
}
|
||||
public override FSLoadSceneOperation LoadSceneOperation(AssetInfo assetInfo, LoadSceneParameters loadParams, bool suspendLoad)
|
||||
{
|
||||
var operation = new AssetBundleLoadSceneOperation(assetInfo, loadParams, suspendLoad);
|
||||
OperationSystem.StartOperation(_fileSystem.PackageName, operation);
|
||||
return operation;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 80ce0631d38cf74458c902fb325afb81
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -69,7 +69,7 @@ internal class TTFSLoadBundleOperation : FSLoadBundleOperation
|
|||
else
|
||||
{
|
||||
_steps = ESteps.Done;
|
||||
Result = new AssetBundleResult(_fileSystem, _bundle, assetBundle, null);
|
||||
Result = new TTAssetBundleResult(_fileSystem, _bundle, assetBundle);
|
||||
Status = EOperationStatus.Succeed;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -67,7 +67,7 @@ internal class WXFSLoadBundleOperation : FSLoadBundleOperation
|
|||
else
|
||||
{
|
||||
_steps = ESteps.Done;
|
||||
Result = new AssetBundleResult(_fileSystem, _bundle, assetBundle, null);
|
||||
Result = new WXAssetBundleResult(_fileSystem, _bundle, assetBundle);
|
||||
Status = EOperationStatus.Succeed;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue