Support fast build mode.
支持快速构建模式,真实的实现EditorPlayMode的运行时环境。
This commit is contained in:
@@ -9,34 +9,19 @@ namespace YooAsset
|
||||
{
|
||||
if (string.IsNullOrEmpty(resourceRoot) == false)
|
||||
_resourceRoot = PathHelper.GetRegularPath(resourceRoot);
|
||||
}
|
||||
|
||||
#if UNITY_EDITOR
|
||||
LocationServicesHelper.InitEditorPlayMode(false);
|
||||
#endif
|
||||
}
|
||||
|
||||
public string ConvertLocationToAssetPath(YooAssets.EPlayMode playMode, string location)
|
||||
public string ConvertLocationToAssetPath(string location)
|
||||
{
|
||||
location = CombineAssetPath(_resourceRoot, location);
|
||||
if (playMode == YooAssets.EPlayMode.EditorPlayMode)
|
||||
if (string.IsNullOrEmpty(_resourceRoot))
|
||||
{
|
||||
#if UNITY_EDITOR
|
||||
return LocationServicesHelper.ConvertLocationToAssetPath(location);
|
||||
#else
|
||||
throw new System.NotImplementedException();
|
||||
#endif
|
||||
return YooAssets.MappingToAssetPath(location);
|
||||
}
|
||||
else
|
||||
{
|
||||
return location;
|
||||
string tempLocation = $"{_resourceRoot}/{location}";
|
||||
return YooAssets.MappingToAssetPath(tempLocation);
|
||||
}
|
||||
}
|
||||
private string CombineAssetPath(string root, string location)
|
||||
{
|
||||
if (string.IsNullOrEmpty(root))
|
||||
return location;
|
||||
else
|
||||
return $"{root}/{location}";
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user