浏览代码

change static variable to player prefs

/pyrception-integration
leopoldo-zugasti 3 年前
当前提交
5713fc70
共有 1 个文件被更改,包括 19 次插入7 次删除
  1. 26
      com.unity.perception/Editor/Pyrception/PyrceptionInstaller.cs

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


using System;
using System.Diagnostics;
using System.IO;
using UnityEditor;

#if UNITY_EDITOR_WIN
private static bool RestartBrowser()
{
currentProcessId = PlayerPrefs.HasKey("currentProcessId") ? PlayerPrefs.GetInt("currentProcessId") : -1;
Process.Start("http://localhost:8501");
return true;
if (proc.HasExited)
{
PlayerPrefs.SetInt("currentProcessId", -1);
return false;
}
else
{
Process.Start("http://localhost:8501");
return true;
}
catch(System.Exception e)
catch (ArgumentException)
currentProcessId = -1;
PlayerPrefs.SetInt("currentProcessId", -1);
PlayerPrefs.SetInt("currentProcessId", -1);
#elif UNITY_EDITOR_OSX || true
#elif UNITY_EDITOR_OSX
private static void KillProcess()
{

if (!waitForExit)
{
#if UNITY_EDITOR_WIN
if (currentProcessId == -1)
currentProcessId = cmd.Id;
if (!PlayerPrefs.HasKey("currentProcessId") || PlayerPrefs.GetInt("currentProcessId") == -1)
PlayerPrefs.SetInt("currentProcessId", cmd.Id);
#elif UNITY_EDITOR_OSX
currentProcessId = cmd.Id;
#endif

正在加载...
取消
保存