コード例 #1
0
 public static List <GraphCreator> FindGraphCreators()
 {
     if (_graphCreators == null)
     {
         _graphCreators = EditorReflectionUtility.GetListOfType <GraphCreator>();
         _graphCreators.Sort((x, y) => {
             return(CompareUtility.Compare(x.menuName, x.order, y.menuName, y.order));
         });
     }
     return(_graphCreators);
 }
コード例 #2
0
ファイル: HierarchyDrawer.cs プロジェクト: hagusen/AI-Testing
 public static List <HierarchyDrawer> FindHierarchyDrawer()
 {
     if (_drawers == null)
     {
         _drawers = EditorReflectionUtility.GetListOfType <HierarchyDrawer>();
         _drawers.Sort((x, y) => {
             return(CompareUtility.Compare(x.order, y.order));
         });
     }
     return(_drawers);
 }
コード例 #3
0
 public static List <FieldDecorator> FindDecorators()
 {
     if (_fieldDecorators == null)
     {
         _fieldDecorators = new List <FieldDecorator>();
         foreach (var assembly in EditorReflectionUtility.GetAssemblies())
         {
             try {
                 foreach (System.Type type in EditorReflectionUtility.GetAssemblyTypes(assembly))
                 {
                     if (type.IsSubclassOf(typeof(FieldDecorator)) && ReflectionUtils.CanCreateInstance(type))
                     {
                         var control = ReflectionUtils.CreateInstance(type) as FieldDecorator;
                         _fieldDecorators.Add(control);
                     }
                 }
             }
             catch { continue; }
         }
         _fieldDecorators.Sort((x, y) => CompareUtility.Compare(x.order, y.order));
     }
     return(_fieldDecorators);
 }
コード例 #4
0
 /// <summary>
 /// Find all graph system attributes.
 /// </summary>
 /// <returns></returns>
 public static List <GraphSystemAttribute> FindGraphSystemAttributes()
 {
     if (_graphSystems == null)
     {
         _graphSystems = new List <GraphSystemAttribute>();
         foreach (var assembly in EditorReflectionUtility.GetAssemblies())
         {
             try {
                 foreach (System.Type type in EditorReflectionUtility.GetAssemblyTypes(assembly))
                 {
                     if (type.IsDefined(typeof(GraphSystemAttribute), false))
                     {
                         var menuItem = (GraphSystemAttribute)type.GetCustomAttributes(typeof(GraphSystemAttribute), false)[0];
                         menuItem.type = type;
                         _graphSystems.Add(menuItem);
                     }
                 }
             }
             catch { continue; }
         }
         _graphSystems.Sort((x, y) => CompareUtility.Compare(x.menu, x.order, y.menu, y.order));
     }
     return(_graphSystems);
 }