浏览代码

MacOs PlayerPrefs fix

/pyrception-integration
leopoldo-zugasti 3 年前
当前提交
17cf455f
共有 1 个文件被更改,包括 8 次插入5 次删除
  1. 13
      com.unity.perception/Editor/Pyrception/PyrceptionInstaller.cs

13
com.unity.perception/Editor/Pyrception/PyrceptionInstaller.cs


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;
}

正在加载...
取消
保存