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 32 33 34 35 36 37 38 39 40 41
   | using UnityEditor; using UnityEngine;
  public class ABTools : EditorWindow {     private int nowSelIndex = 0;     private string[] targetStrings = new string[] { "PC", "IOS", "Android" };     private string serverIP = "ftp://127.0.0.1";
      [MenuItem("AB包工具/打开工具窗口")]     private static void OpenWindow()     {         ABTools window = EditorWindow.GetWindowWithRect<ABTools>(new Rect(0, 0, 350, 220));         window.Show();     }
      private void OnGUI()     {         GUI.Label(new Rect(10, 10, 150, 15), "平台选择");                  nowSelIndex = GUI.Toolbar(new Rect(10, 30, 330, 20), nowSelIndex, targetStrings);                  GUI.Label(new Rect(10, 60, 150, 15), "资源服务器地址");         serverIP = GUI.TextField(new Rect(10, 80, 330, 20), serverIP);                  if (GUI.Button(new Rect(10, 110, 100, 40), "创建对比文件"))         {                      }                  if (GUI.Button(new Rect(115, 110, 225, 40), "保存默认资源到StreamingAssets"))         {                      }                  if (GUI.Button(new Rect(10, 160, 330, 40), "上传AB包和对比文件"))         {                      }     } }
   |