Files
YooAssetScene/Assets/YooAsset/Runtime/Services/LocationServices/DefaultLocationServices.cs
T
hevinci 665a16fe60 Support fast build mode.
支持快速构建模式,真实的实现EditorPlayMode的运行时环境。
2022-05-02 23:15:09 +08:00

27 lines
611 B
C#

namespace YooAsset
{
public class DefaultLocationServices : ILocationServices
{
private readonly string _resourceRoot;
public DefaultLocationServices(string resourceRoot)
{
if (string.IsNullOrEmpty(resourceRoot) == false)
_resourceRoot = PathHelper.GetRegularPath(resourceRoot);
}
public string ConvertLocationToAssetPath(string location)
{
if (string.IsNullOrEmpty(_resourceRoot))
{
return YooAssets.MappingToAssetPath(location);
}
else
{
string tempLocation = $"{_resourceRoot}/{location}";
return YooAssets.MappingToAssetPath(tempLocation);
}
}
}
}