void DrawTimerTask(CSTimer.TimerTask timerTask) { GUILayout.BeginVertical("GroupBox"); { GUILayout.Label("name:" + timerTask.taskName); if (timerTask.isValid) { GUILayout.Label("累计时间:" + timerTask.cumulativeTime); GUILayout.Label("更新频率:" + timerTask.updateFrequence); GUILayout.Label("timeScale:" + timerTask.timeScale); GUILayout.BeginHorizontal(); if (GUILayout.Button("Cancel")) { mCSTimer.CancelTimer(timerTask.taskName); } if (GUILayout.Button(timerTask.isPause ? "Resume" : "Pause")) { timerTask.isPause = !timerTask.isPause; } GUILayout.EndHorizontal(); } else { GUILayout.Label("已失效"); } } GUILayout.EndVertical(); }
private void ClearInfoListTimer() { if (_infoListTimer != null) { _infoListTimer.Cancel(); _infoListTimer = null; } }
private void ClearTimer() { if (_timer != null) { _timer.Cancel(); _timer = null; } }
private void AnalysisJson(string str, bool all) { _all = all; Debug.Log("请求异常列表返回str: " + str); infoList = JsonMapper.ToObject <List <TestInInfo> >(str); infoList.Sort(delegate(TestInInfo r1, TestInInfo r2) { return(r2.crs.CompareTo(r1.crs)); }); if (infoList.Count > 0) { ClearTimer(); _timer = CSTimer.Instance.SetupTimer("TestInTimer", TestInTimer, 1f); } }
void OnGUI() { GUILayout.TextField("--------------Andriod---------------"); GUILayout.TextField(String.Format("路径:{0}", TestInPath.ANDRIOD_PATH_ALL)); if (GUILayout.Button("[所有]提交已修复的", GUILayout.Width(200))) { app_key = andriod_app_key; secret_key = andriod_secret_key; platform = Platform.ANDRIOD; UpdateJson(true); } if (GUILayout.Button("[所有]导出所有[提交后再导出]", GUILayout.Width(200))) { app_key = andriod_app_key; secret_key = andriod_secret_key; platform = Platform.ANDRIOD; _all = true; ClearTimer(); ClearInfoListTimer(); infoList = null; _infoListTimer = CSTimer.Instance.SetupTimer("TestInListTimer", TestInfoListTimer, 3f); _httpController.StartCoroutine(RequestJson(_all)); } GUILayout.TextField("--------------以下针对部分操作---------------"); GUILayout.TextField(String.Format("路径:{0}", TestInPath.ANDRIOD_PATH_PART)); if (GUILayout.Button("[部分]提交已修复的", GUILayout.Width(200))) { app_key = andriod_app_key; secret_key = andriod_secret_key; platform = Platform.ANDRIOD; UpdateJson(false); } if (GUILayout.Button("[部分]只导出未修复部分[提交后再导出]", GUILayout.Width(200))) { app_key = andriod_app_key; secret_key = andriod_secret_key; platform = Platform.ANDRIOD; _all = false; ClearTimer(); ClearInfoListTimer(); infoList = null; _infoListTimer = CSTimer.Instance.SetupTimer("TestInListTimer", TestInfoListTimer, 3f); _httpController.StartCoroutine(RequestJson(_all)); } GUILayout.TextField(""); GUILayout.TextField(""); GUILayout.TextField(""); GUILayout.TextField(""); GUILayout.TextField("--------------Ios---------------"); GUILayout.TextField(String.Format("路径:{0}", TestInPath.IOS_PATH_ALL)); if (GUILayout.Button("[所有]提交已修复的", GUILayout.Width(200))) { app_key = ios_app_key; secret_key = ios_secret_key; platform = Platform.IOS; UpdateJson(true); } if (GUILayout.Button("[所有]导出所有[提交后再导出]", GUILayout.Width(200))) { app_key = ios_app_key; secret_key = ios_secret_key; platform = Platform.IOS; _all = true; ClearTimer(); ClearInfoListTimer(); infoList = null; _infoListTimer = CSTimer.Instance.SetupTimer("TestInListTimer", TestInfoListTimer, 3f); _httpController.StartCoroutine(RequestJson(_all)); } GUILayout.TextField("--------------以下针对部分操作---------------"); GUILayout.TextField(String.Format("路径:{0}", TestInPath.IOS_PATH_PART)); if (GUILayout.Button("[部分]提交已修复的", GUILayout.Width(200))) { app_key = ios_app_key; secret_key = ios_secret_key; platform = Platform.IOS; UpdateJson(false); } if (GUILayout.Button("[部分]只导出未修复部分[提交后再导出]", GUILayout.Width(200))) { app_key = ios_app_key; secret_key = ios_secret_key; platform = Platform.IOS; _all = false; ClearTimer(); ClearInfoListTimer(); infoList = null; _infoListTimer = CSTimer.Instance.SetupTimer("TestInListTimer", TestInfoListTimer, 3f); _httpController.StartCoroutine(RequestJson(_all)); } }