暂无描述
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

BuildGetEventExtraInfoFunction.cs 1.6KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. using System;
  2. using UnityEngine;
  3. using PlasticGui;
  4. using Unity.PlasticSCM.Editor.UI;
  5. namespace Unity.PlasticSCM.Editor
  6. {
  7. internal static class BuildGetEventExtraInfoFunction
  8. {
  9. internal static Func<string> ForPingEvent()
  10. {
  11. return () =>
  12. {
  13. return GetScreenResolution() +
  14. GetUnityEditorVersion() +
  15. GetUnityPluginVersion() +
  16. GetPingEventExtraInfo.GetChangelistsEnabled(
  17. PlasticGuiConfig.Get().Configuration);
  18. };
  19. }
  20. static string GetScreenResolution()
  21. {
  22. string resolution = null;
  23. GUIActionRunner.RunGUIAction(delegate
  24. {
  25. resolution = ScreenResolution.Get();
  26. });
  27. if (resolution == null)
  28. return string.Empty;
  29. return string.Format(":screenresolution={0}", resolution);
  30. }
  31. static string GetUnityEditorVersion()
  32. {
  33. string unityEditorVersion = Application.unityVersion;
  34. if (string.IsNullOrEmpty(unityEditorVersion))
  35. return string.Empty;
  36. return string.Format(":unityEditorVersion={0}",
  37. unityEditorVersion);
  38. }
  39. static string GetUnityPluginVersion()
  40. {
  41. string unityPluginVersion = UVCPackageVersion.Value;
  42. if (string.IsNullOrEmpty(unityPluginVersion))
  43. return string.Empty;
  44. return string.Format(":unityPluginVersion={0}",
  45. unityPluginVersion);
  46. }
  47. }
  48. }