[refactor] 调整Installer接口

main
walon 2023-04-29 12:41:47 +08:00
parent 8fd9b2ec82
commit 1045538b40
1 changed files with 7 additions and 2 deletions

View File

@ -166,11 +166,11 @@ namespace HybridCLR.Editor.Installer
return $"{contentPath}/il2cpp"; return $"{contentPath}/il2cpp";
} }
public string ApplicationIl2cppPath => GetIl2CppPathByContentPath(EditorApplication.applicationContentsPath);
public void InstallDefaultHybridCLR() public void InstallDefaultHybridCLR()
{ {
string libil2cppDir = PrepareLibil2cppWithHybridclrFromGitRepo(); InstallFromLocal(PrepareLibil2cppWithHybridclrFromGitRepo());
RunInitLocalIl2CppData(GetIl2CppPathByContentPath(EditorApplication.applicationContentsPath), libil2cppDir, _curVersion);
} }
public bool HasInstalledHybridCLR() public bool HasInstalledHybridCLR()
@ -233,6 +233,11 @@ namespace HybridCLR.Editor.Installer
return $"{il2cppPlusRepoDir}/libil2cpp"; return $"{il2cppPlusRepoDir}/libil2cpp";
} }
public void InstallFromLocal(string libil2cppWithHybridclrSourceDir)
{
RunInitLocalIl2CppData(ApplicationIl2cppPath, libil2cppWithHybridclrSourceDir, _curVersion);
}
private void RunInitLocalIl2CppData(string editorIl2cppPath, string libil2cppWithHybridclrSourceDir, UnityVersion version) private void RunInitLocalIl2CppData(string editorIl2cppPath, string libil2cppWithHybridclrSourceDir, UnityVersion version)
{ {
if (!IsComaptibleVersion()) if (!IsComaptibleVersion())