From 46fdd6253e06806aa8956ffc5503e463677e1b9f Mon Sep 17 00:00:00 2001 From: Antonis Makropoulos Date: Tue, 3 Sep 2024 14:06:17 +0300 Subject: [PATCH] fix adding grammar from StreamingAssets --- Runtime/LLMUnitySetup.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Runtime/LLMUnitySetup.cs b/Runtime/LLMUnitySetup.cs index 67958363..69ceec15 100644 --- a/Runtime/LLMUnitySetup.cs +++ b/Runtime/LLMUnitySetup.cs @@ -420,6 +420,9 @@ public static string AddAsset(string assetPath) LogError($"{assetPath} does not exist!"); return null; } + string assetDir = GetAssetPath(); + if (IsSubPath(assetPath, assetDir)) return RelativePath(assetPath, assetDir); + string filename = Path.GetFileName(assetPath); string fullPath = GetAssetPath(filename); AssetDatabase.StartAssetEditing();