@@ -366,24 +366,18 @@ static async Task DownloadAndExtractInsideDirectory(string url, string path, str
366
366
367
367
static async Task DownloadLibrary ( )
368
368
{
369
- void DeleteFileAndMeta ( string path )
370
- {
371
- if ( File . Exists ( path + ".meta" ) ) File . Delete ( path + ".meta" ) ;
372
- if ( File . Exists ( path ) ) File . Delete ( path ) ;
373
- }
369
+ if ( libraryProgress < 1 ) return ;
370
+ libraryProgress = 0 ;
374
371
375
372
try
376
373
{
377
374
string setupDir = Path . Combine ( libraryPath , "setup" ) ;
378
375
Directory . CreateDirectory ( setupDir ) ;
379
376
380
- string lockFile = Path . Combine ( setupDir , "LLMUnitySetup.lock" ) ;
381
- if ( File . Exists ( lockFile ) ) return ;
382
- CreateEmptyFile ( lockFile ) ;
383
-
384
- libraryProgress = 0 ;
377
+ // setup LlamaLib in StreamingAssets
385
378
await DownloadAndExtractInsideDirectory ( LlamaLibURL , libraryPath , setupDir ) ;
386
379
380
+ // setup LlamaLib in Plugins for Android
387
381
AssetDatabase . StartAssetEditing ( ) ;
388
382
string androidDir = Path . Combine ( libraryPath , "android" ) ;
389
383
if ( Directory . Exists ( androidDir ) )
@@ -397,15 +391,15 @@ void DeleteFileAndMeta(string path)
397
391
}
398
392
AssetDatabase . StopAssetEditing ( ) ;
399
393
394
+ // setup LlamaLib extras in StreamingAssets
400
395
if ( FullLlamaLib ) await DownloadAndExtractInsideDirectory ( LlamaLibExtensionURL , libraryPath , setupDir ) ;
401
-
402
- libraryProgress = 1 ;
403
- DeleteFileAndMeta ( lockFile ) ;
404
396
}
405
397
catch ( Exception e )
406
398
{
407
399
LogError ( e . Message ) ;
408
400
}
401
+
402
+ libraryProgress = 1 ;
409
403
}
410
404
411
405
private static void SetLibraryProgress ( float progress )
0 commit comments