Skip to content

Commit

Permalink
Fix texture loading for editor scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
andybak committed Nov 13, 2024
1 parent 4effae1 commit 1075fed
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Packages/icosa-api-client-unity/Editor/PtUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,10 @@ public static string GetPtBaseLocalPath() {
/// <param name="relativePath">The relative path were the texture is located. For example,
/// this could be Editor/Textures/PolyToolkitTitle.png.</param>
/// <returns>The texture.</returns>
public static Texture2D LoadTexture2DFromRelativePath(string relativePath) {
string basePath = PtUtils.GetPtBaseLocalPath();
return AssetDatabase.LoadAssetAtPath<Texture2D>(Path.Combine(basePath, relativePath));
public static Texture2D LoadTexture2DFromRelativePath(string relativePath)
{
var path = $"Packages/com.icosa.icosa-api-client-unity/{relativePath}";
return AssetDatabase.LoadAssetAtPath<Texture2D>(path);
}
}
}

0 comments on commit 1075fed

Please sign in to comment.