Skip to content

Commit 4d50b70

Browse files
committed
Added Editor assembly capabilities
1 parent 82ed5ad commit 4d50b70

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

MLAPI-Editor/MLAPIEditor.cs

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
#if INCLUDE_INSTALLER
1+
#define INCLUDE_INSTALLER
2+
#if INCLUDE_INSTALLER
23
using System;
34
using System.Collections;
45
using System.Collections.Generic;
@@ -434,7 +435,11 @@ private IEnumerator InstallRelease(int index)
434435
if (Directory.Exists(Application.dataPath + "/MLAPI/Lib/"))
435436
Directory.Delete(Application.dataPath + "/MLAPI/Lib/", true);
436437

438+
if (Directory.Exists(Application.dataPath + "/Editor/"))
439+
Directory.Delete(Application.dataPath + "/Editor/MLAPI/", false);
440+
437441
Directory.CreateDirectory(Application.dataPath + "/MLAPI/Lib/");
442+
Directory.CreateDirectory(Application.dataPath + "/Editor/MLAPI/");
438443

439444
bool downloadFail = false;
440445
for (int i = 0; i < releases[index].assets.Length; i++)
@@ -462,7 +467,15 @@ private IEnumerator InstallRelease(int index)
462467
statusMessage = "Writing " + releases[index].assets[i].name + " to disk";
463468
yield return null;
464469

465-
File.WriteAllBytes(Application.dataPath + "/MLAPI/Lib/" + releases[index].assets[i].name, www.bytes);
470+
if (!releases[index].assets[i].name.ToLower().Contains("editor"))
471+
{
472+
File.WriteAllBytes(Application.dataPath + "/MLAPI/Lib/" + releases[index].assets[i].name, www.bytes);
473+
}
474+
else
475+
{
476+
File.WriteAllBytes(Application.dataPath + "/Editor/MLAPI/" + releases[index].assets[i].name, www.bytes);
477+
}
478+
466479
yield return null;
467480
}
468481
progress = i;

0 commit comments

Comments
 (0)