PackPlatformUnityGUI.cs 5.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. using System.IO;
  2. using UnityEngine;
  3. using UnityEditor;
  4. namespace Pack
  5. {
  6. public partial class PackPlatformUnity
  7. {
  8. private FileReorderableList m_SplashScreenReorderableList;
  9. private static int[] s_ObscureOffsetValues = new int[]
  10. {
  11. 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31
  12. };
  13. protected override void DrawPlatformGameGUI(bool editable, PackPlatformBase sourcePackPlatform)
  14. {
  15. base.DrawPlatformGameGUI(editable, sourcePackPlatform);
  16. PackPlatformUnity sourcePackPlatformUnity = sourcePackPlatform as PackPlatformUnity;
  17. PackGUI.DrawMutliSelectField("编译宏", PackConstant.AllDefineSymbols, sourcePackPlatformUnity.defineSymbols, ref defineSymbols, PackConstant.NeedFulDefineSymbols, -1);
  18. if (m_SplashScreenReorderableList == null)
  19. {
  20. m_SplashScreenReorderableList = new FileReorderableList("从上到下依次显示", splashScreenRelativeFiles, sourcePackPlatformUnity.splashScreenRelativeFiles, null, Application.dataPath + PackConstant.PluginAndroidSrcPath, ".png");
  21. }
  22. else
  23. {
  24. m_SplashScreenReorderableList.SetParams(splashScreenRelativeFiles, sourcePackPlatformUnity.splashScreenRelativeFiles, null, Application.dataPath + PackConstant.PluginAndroidSrcPath, ".png");
  25. }
  26. float height = m_SplashScreenReorderableList.GetHeight();
  27. Rect totalPosition = EditorGUILayout.GetControlRect(true, height, PackGUI.styles.label);
  28. Rect labelPosition = new Rect(totalPosition.x + PackGUI.indent, totalPosition.y, EditorGUIUtility.labelWidth - PackGUI.indent, PackGUI.kSingleLineHeight);
  29. int id = GUIUtility.GetControlID(PackGUI.s_DelayedTextFieldHash, FocusType.Keyboard, labelPosition);
  30. EditorGUI.HandlePrefixLabel(totalPosition, labelPosition, EditorGUIUtility.TrTextContent("Android目录替换", PackConstant.PluginAndroidDestPath), id, PackGUI.styles.label);
  31. Rect fieldPosition = new Rect(totalPosition.x + PackGUI.indent + EditorGUIUtility.labelWidth, totalPosition.y, totalPosition.width - PackGUI.indent - EditorGUIUtility.labelWidth - 100, height);
  32. Rect resetPosition = new Rect(totalPosition.x + totalPosition.width - 90, totalPosition.y, 80, PackGUI.kSingleLineHeight);
  33. m_SplashScreenReorderableList.DoList(fieldPosition);
  34. if (!ArrayUtility.ArrayEquals(sourcePackPlatformUnity.splashScreenRelativeFiles.ToArray(), splashScreenRelativeFiles.ToArray()))
  35. {
  36. if (GUI.Button(resetPosition, EditorGUIUtility.TrTextContent("重置默认", string.Join(";", sourcePackPlatformUnity.splashScreenRelativeFiles)), PackGUI.styles.miniButton))
  37. {
  38. splashScreenRelativeFiles.Clear();
  39. splashScreenRelativeFiles.AddRange(sourcePackPlatformUnity.splashScreenRelativeFiles);
  40. }
  41. }
  42. PackGUI.DrawSelectFileFieldWithFilters("Logo的路径", Application.dataPath + PackConstant.LogoSourcePath, PackConstant.PngFilters, sourcePackPlatformUnity.logo1RelativePath, ref logo1RelativePath);
  43. PackGUI.DrawSelectFolderField("Login的路径", Application.dataPath + PackConstant.LoginSourcePath, sourcePackPlatformUnity.loginRelativePath, ref loginRelativePath);
  44. PackGUI.DrawSelectFolderField("修改游戏资源的路径", Application.dataPath + PackConstant.GameAssetsSourcePath, sourcePackPlatformUnity.gameAssetsPath, ref gameAssetsPath);
  45. PackGUI.DrawDelayedTextField("sdk验证Url", sourcePackPlatformUnity.sdkVerifyUrl, ref sdkVerifyUrl, true);
  46. PackGUI.DrawDelayedTextField("服务器列Url", sourcePackPlatformUnity.serverListUrl, ref serverListUrl, true);
  47. PackGUI.DrawDelayedTextField("公告Url", sourcePackPlatformUnity.notifyUrl, ref notifyUrl, true);
  48. PackGUI.DrawDelayedTextField("特殊信息Url(logo显示状态)", sourcePackPlatformUnity.specialInfoUrl, ref specialInfoUrl, true);
  49. PackGUI.DrawDelayedTextField("专属客服信息Url", sourcePackPlatformUnity.customerServiceInfoUrl, ref customerServiceInfoUrl, true);
  50. PackGUI.DrawToggleField("特殊功能屏蔽", "对应功能\n兑换码", sourcePackPlatformUnity.specialFuncShield, ref specialFuncShield);
  51. EditorGUILayout.Space();
  52. EditorGUILayout.BeginVertical(PackGUI.styles.box);
  53. EditorGUILayout.LabelField("资源混淆", PackGUI.styles.boldLabel);
  54. EditorGUI.indentLevel += 1;
  55. EditorGUILayout.Space();
  56. PackGUI.DrawDelayedTextField("资源混淆key", "不混淆,则值设置为空内容", sourcePackPlatformUnity.obscureKey, ref obscureKey);
  57. //PackGUI.DrawIntSlider("资源默认混淆长度", "避免填充数据过多\n导致最终文件过大\n目前设定0 ~ 0xFFF", 0, 0xFFF, sourcePackPlatformUnity.obscureOffsetMin, ref obscureOffsetMin);
  58. PackGUI.DrawMutliSelectField("资源混淆长度计算取MD5位值", "避免填充数据过多\n导致最终文件过大\n目前设定最多选3位", s_ObscureOffsetValues, sourcePackPlatformUnity.obscureOffsetValues, ref obscureOffsetValues, null, 3, false);
  59. EditorGUI.indentLevel -= 1;
  60. EditorGUILayout.EndVertical();
  61. }
  62. }
  63. }