mirror of
https://github.com/tuyoogame/YooAsset.git
synced 2026-05-24 17:50:15 +00:00
update runtime code
移除了ILocationServices接口类。 增加了bool CheckLocationValid(string location)方法。
This commit is contained in:
@@ -28,6 +28,11 @@ namespace YooAsset
|
||||
/// </summary>
|
||||
string MappingToAssetPath(string location);
|
||||
|
||||
/// <summary>
|
||||
/// 尝试映射为资源路径
|
||||
/// </summary>
|
||||
string TryMappingToAssetPath(string location);
|
||||
|
||||
/// <summary>
|
||||
/// 获取所属的包裹名
|
||||
/// </summary>
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
|
||||
namespace YooAsset
|
||||
{
|
||||
public interface ILocationServices
|
||||
{
|
||||
/// <summary>
|
||||
/// 定位地址转换为资源路径
|
||||
/// </summary>
|
||||
string ConvertLocationToAssetPath(AssetsPackage package, string location);
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cfc81e18e5b5f6f4b821c7427b34d349
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6e400ee1e8b3556479bfa493ff7fe778
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,11 +0,0 @@
|
||||
|
||||
namespace YooAsset
|
||||
{
|
||||
public class AddressLocationServices : ILocationServices
|
||||
{
|
||||
string ILocationServices.ConvertLocationToAssetPath(AssetsPackage package, string location)
|
||||
{
|
||||
return package.MappingToAssetPath(location);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a8d6592eded144142afcf85c79cf1ce4
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,27 +0,0 @@
|
||||
|
||||
namespace YooAsset
|
||||
{
|
||||
public class DefaultLocationServices : ILocationServices
|
||||
{
|
||||
private readonly string _resourceRoot;
|
||||
|
||||
public DefaultLocationServices(string resourceRoot)
|
||||
{
|
||||
if (string.IsNullOrEmpty(resourceRoot) == false)
|
||||
_resourceRoot = PathHelper.GetRegularPath(resourceRoot);
|
||||
}
|
||||
|
||||
string ILocationServices.ConvertLocationToAssetPath(AssetsPackage package, string location)
|
||||
{
|
||||
if (string.IsNullOrEmpty(_resourceRoot))
|
||||
{
|
||||
return package.MappingToAssetPath(location);
|
||||
}
|
||||
else
|
||||
{
|
||||
string tempLocation = $"{_resourceRoot}/{location}";
|
||||
return package.MappingToAssetPath(tempLocation);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8d996937ba73c9b4bb942b8ba6f43398
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user