Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions com.unity.render-pipelines.core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Fixed the issue with the special Turkish i, when looking for the m_IsGlobal property in VolumeEditor. (case 1276892)
- Fixed texture gather macros for GLCore and moved them from target 4.6 to target 4.5.
- Fixed cubemap array macros for GLCore.
- Built-in resources will also throw invalid import if the ResourceReloader is unable to retrive the resource.

## [14.0.0] - 2021-11-17

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,19 +190,34 @@ static UnityEngine.Object Load(string path, Type type, bool builtin)

// Else the path is good. Attempt loading resource if AssetDatabase available.
UnityEngine.Object result;
if (builtin && type == typeof(Shader))
{
result = Shader.Find(path);
}
else
try
{
result = AssetDatabase.LoadAssetAtPath(path, type);
if (builtin && type == typeof(Shader))
{
result = Shader.Find(path);
}
else
{
result = AssetDatabase.LoadAssetAtPath(path, type);

if (IsNull(result))
result = Resources.GetBuiltinResource(type, path);
if (IsNull(result))
result = Resources.GetBuiltinResource(type, path);

if (IsNull(result))
result = AssetDatabase.GetBuiltinExtraResource(type, path);
if (IsNull(result))
result = AssetDatabase.GetBuiltinExtraResource(type, path);
}
}
catch (Exception e)
{
//guid is not null as checked before unless this is builtin
if (!builtin)
{
var ex = new Exception($"Cannot load. Path {path} is correct but AssetDatabase cannot load now.");
ex.Data["InvalidImport"] = 1;
throw ex;
}
else
throw e;
}

if (IsNull(result))
Expand Down