mirror of
https://github.com/Alex-Rachel/TEngine.git
synced 2025-08-14 16:51:28 +00:00
TE6 打飞机Demo
TE6 打飞机Demo
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
|
||||
namespace YooAsset
|
||||
{
|
||||
/// <summary>
|
||||
/// 解压文件系统
|
||||
/// </summary>
|
||||
internal class DefaultUnpackFileSystem : DefaultCacheFileSystem
|
||||
{
|
||||
public DefaultUnpackFileSystem()
|
||||
{
|
||||
}
|
||||
public override void OnCreate(string packageName, string rootDirectory)
|
||||
{
|
||||
base.OnCreate(packageName, rootDirectory);
|
||||
|
||||
// 注意:重写保存根目录和临时目录
|
||||
_cacheBundleFilesRoot = PathUtility.Combine(_packageRoot, DefaultUnpackFileSystemDefine.SaveBundleFilesFolderName);
|
||||
_cacheManifestFilesRoot = PathUtility.Combine(_packageRoot, DefaultUnpackFileSystemDefine.SaveManifestFilesFolderName);
|
||||
_tempFilesRoot = PathUtility.Combine(_packageRoot, DefaultUnpackFileSystemDefine.TempFilesFolderName);
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0bb4584d46f520741bcf6f52b67746d5
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -0,0 +1,26 @@
|
||||
|
||||
namespace YooAsset
|
||||
{
|
||||
internal class DefaultUnpackFileSystemDefine
|
||||
{
|
||||
/// <summary>
|
||||
/// 文件系统的优先级
|
||||
/// </summary>
|
||||
public const int DefaultPriority = 11;
|
||||
|
||||
/// <summary>
|
||||
/// 保存的资源文件的文件夹名称
|
||||
/// </summary>
|
||||
public const string SaveBundleFilesFolderName = "UnpackBundleFiles";
|
||||
|
||||
/// <summary>
|
||||
/// 保存的清单文件的文件夹名称
|
||||
/// </summary>
|
||||
public const string SaveManifestFilesFolderName = "UnpackManifestFiles";
|
||||
|
||||
/// <summary>
|
||||
/// 下载的临时文件的文件夹名称
|
||||
/// </summary>
|
||||
public const string TempFilesFolderName = "UnpackTempFiles";
|
||||
}
|
||||
}
|
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ee46c041e2affd349929df43af3f21c1
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -0,0 +1,34 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace YooAsset
|
||||
{
|
||||
internal class DefaultUnpackRemoteServices : IRemoteServices
|
||||
{
|
||||
private readonly string _buildinPackageRoot;
|
||||
protected readonly Dictionary<string, string> _mapping = new Dictionary<string, string>(10000);
|
||||
|
||||
public DefaultUnpackRemoteServices(string buildinPackRoot)
|
||||
{
|
||||
_buildinPackageRoot = buildinPackRoot;
|
||||
}
|
||||
string IRemoteServices.GetRemoteMainURL(string fileName)
|
||||
{
|
||||
return GetFileLoadURL(fileName);
|
||||
}
|
||||
string IRemoteServices.GetRemoteFallbackURL(string fileName)
|
||||
{
|
||||
return GetFileLoadURL(fileName);
|
||||
}
|
||||
|
||||
private string GetFileLoadURL(string fileName)
|
||||
{
|
||||
if (_mapping.TryGetValue(fileName, out string url) == false)
|
||||
{
|
||||
string filePath = PathUtility.Combine(_buildinPackageRoot, fileName);
|
||||
url = DownloadSystemHelper.ConvertToWWWPath(filePath);
|
||||
_mapping.Add(fileName, url);
|
||||
}
|
||||
return url;
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 32c355598c9dff847af87f4a867a2d5c
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Reference in New Issue
Block a user