update runtime code

移除了ILocationServices接口类。
增加了bool CheckLocationValid(string location)方法。
This commit is contained in:
hevinci
2022-10-21 18:36:03 +08:00
parent d7760cd34d
commit bb64ff7278
16 changed files with 70 additions and 148 deletions

View File

@@ -28,6 +28,11 @@ namespace YooAsset
/// </summary>
string MappingToAssetPath(string location);
/// <summary>
/// 尝试映射为资源路径
/// </summary>
string TryMappingToAssetPath(string location);
/// <summary>
/// 获取所属的包裹名
/// </summary>

View File

@@ -1,11 +0,0 @@

namespace YooAsset
{
public interface ILocationServices
{
/// <summary>
/// 定位地址转换为资源路径
/// </summary>
string ConvertLocationToAssetPath(AssetsPackage package, string location);
}
}

View File

@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: cfc81e18e5b5f6f4b821c7427b34d349
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 6e400ee1e8b3556479bfa493ff7fe778
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,11 +0,0 @@

namespace YooAsset
{
public class AddressLocationServices : ILocationServices
{
string ILocationServices.ConvertLocationToAssetPath(AssetsPackage package, string location)
{
return package.MappingToAssetPath(location);
}
}
}

View File

@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: a8d6592eded144142afcf85c79cf1ce4
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -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);
}
}
}
}

View File

@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 8d996937ba73c9b4bb942b8ba6f43398
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: