Ejemplo n.º 1
0
        public static IEnumerable <MethodInfo> GetAllMethodsWithAttribute <T>() where T : Attribute
        {
#if UNITY_2019_2_OR_NEWER
            return(UnityEditorTypeCache.GetMethodsWithAttribute <T>());
#else
            return(UnityEditorEditorAssemblies.GetAllMethodsWithAttribute <T>());
#endif
        }
Ejemplo n.º 2
0
        public static void InternalMakeSerializeReferenceAttrName()
        {
            if (s_repDic != null)
            {
                return;
            }

            s_repDic = new Dictionary <int, string>();

            // 差し替え用の文字列を作成しておく
            foreach (var p in UnityEditorEditorAssemblies.GetAllTypesWithAttribute <TypeIDAttribute>())
            {
                var attr = p.GetCustomAttributes(typeof(TypeIDAttribute), false);
                var cls  = $"class: {p.Name}, ns: {p.Namespace}, asm: {p.Assembly.FullName.Split( ',' )[ 0 ]}";
                s_repDic.Add(((TypeIDAttribute)attr[0]).id, cls);
            }
        }
Ejemplo n.º 3
0
 public static IEnumerable <Type> GetAllTypesWithAttribute <T>() where T : Attribute
 {
     return(UnityEditorEditorAssemblies.GetAllTypesWithAttribute <T>());
 }
Ejemplo n.º 4
0
 public static IEnumerable <MethodInfo> GetAllMethodsWithAttribute(Type type)
 {
     return(UnityEditorEditorAssemblies.Internal_GetAllMethodsWithAttribute(type, BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic).Cast <MethodInfo>());
 }
Ejemplo n.º 5
0
 public static IEnumerable <Type> SubclassesOf(Type type)
 {
     return(UnityEditorEditorAssemblies.SubclassesOf(type));
 }