Exemplo n.º 1
0
        private void OnGUI()
        {
            Assembly[]        assemblies = AppDomain.CurrentDomain.GetAssemblies();
            GenericMenu       menu       = new GenericMenu();
            List <CardDefine> cardList   = new List <CardDefine>();

            foreach (var assembly in assemblies)
            {
                string name       = assembly.GetName().Name.Replace('.', '/');
                bool   isSelected = _selectedAssemblyNameList.Contains(name);
                if (isSelected)
                {
                    cardList.AddRange(CardHelper.getCardDefines(new Assembly[] { assembly }));
                }
                menu.AddItem(new GUIContent(name), isSelected, () =>
                {
                    if (!_selectedAssemblyNameList.Contains(name))
                    {
                        _selectedAssemblyNameList.Add(name);
                    }
                    else
                    {
                        _selectedAssemblyNameList.Remove(name);
                    }
                });
            }
            if (EditorGUILayout.DropdownButton(new GUIContent("选择编译集"), FocusType.Keyboard))
            {
                menu.DropDown(GUILayoutUtility.GetLastRect());
            }
            _manager = EditorGUILayout.ObjectField("Table", _manager, typeof(CardManager), true) as CardManager;
            _scroll  = EditorGUILayout.BeginScrollView(_scroll, GUILayout.Width(512), GUILayout.Height(512));
            foreach (var card in cardList)
            {
                GUILayout.Label(card.GetType().Name);
            }
            EditorGUILayout.EndScrollView();
            EditorGUILayout.BeginHorizontal();
            if (GUILayout.Button("导出Xml", GUILayout.Width(128)))
            {
                exportAsXml(cardList);
            }
            if (GUILayout.Button("导出Excel", GUILayout.Width(128)))
            {
                exportAsExcel(cardList);
            }
            EditorGUILayout.EndHorizontal();
        }
 void loadCardList()
 {
     _cardList = new List <CardDefine>();
     foreach (var assembly in _assemblies)
     {
         string name       = assembly.GetName().Name.Replace('.', '/');
         bool   isSelected = _selectedAssemblyNameList.Contains(name);
         if (isSelected)
         {
             _cardList.AddRange(CardHelper.getCardDefines(new Assembly[] { assembly }, new ULogger()
             {
                 blackList = new List <string>()
                 {
                     "Load"
                 }
             }));
         }
     }
 }
Exemplo n.º 3
0
 public static void loadCards()
 {
     _cardDefines = CardHelper.getCardDefines(new Assembly[] { typeof(THHGame).Assembly }, null);
 }