|
|
|
|
|
|
public class PyrceptionInstaller : EditorWindow |
|
|
|
{ |
|
|
|
|
|
|
|
#if UNITY_EDITOR_OSX || true
|
|
|
|
private static int currentProcessId = -1; |
|
|
|
#endif
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Runs pyrception instance in default browser
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
|
|
|
private static bool RestartBrowser() |
|
|
|
{ |
|
|
|
currentProcessId = PlayerPrefs.HasKey("currentProcessId") ? PlayerPrefs.GetInt("currentProcessId") : -1; |
|
|
|
int currentProcessId = PlayerPrefs.HasKey("currentProcessId") ? PlayerPrefs.GetInt("currentProcessId") : -1; |
|
|
|
|
|
|
|
if (currentProcessId != -1) |
|
|
|
{ |
|
|
|
try |
|
|
|
|
|
|
{ |
|
|
|
PlayerPrefs.SetInt("currentProcessId", -1); |
|
|
|
PlayerPrefs.Save(); |
|
|
|
return false; |
|
|
|
} |
|
|
|
else |
|
|
|
|
|
|
catch (ArgumentException) |
|
|
|
{ |
|
|
|
PlayerPrefs.SetInt("currentProcessId", -1); |
|
|
|
PlayerPrefs.Save(); |
|
|
|
PlayerPrefs.Save(); |
|
|
|
return false; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
if (!waitForExit) |
|
|
|
{ |
|
|
|
if (!PlayerPrefs.HasKey("currentProcessId") || PlayerPrefs.GetInt("currentProcessId") == -1) |
|
|
|
{ |
|
|
|
PlayerPrefs.Save(); |
|
|
|
} |
|
|
|
return output; |
|
|
|
} |
|
|
|
|
|
|
|