-
-
Notifications
You must be signed in to change notification settings - Fork 23
/
AttrExplorer.cs
31 lines (28 loc) · 995 Bytes
/
AttrExplorer.cs
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
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System;
using System.Reflection;
// If you toggle the toggle_me it will print a bunch of attributes from the UnityEngine and UnityEditor assembly.
// You may find something new and interesting, including stuff that isn't documented anywhere.
[ExecuteInEditMode]
public class AttrExplorer : MonoBehaviour
{
public bool toggle_me = false;
void OnValidate()
{
System.Reflection.Assembly[] assemblies = System.AppDomain.CurrentDomain.GetAssemblies();
foreach (var assembly in assemblies) {
// Only show attributes for UnityEngine and UnityEditor.
if (assembly.FullName.StartsWith("UnityEngine") ||
assembly.FullName.StartsWith("UnityEditor")) {
Type[] types = assembly.GetTypes();
for (var i = 0; i < types.Length; i++) {
// Check if it is an attribute.
if (types[i].IsSubclassOf(typeof(Attribute)))
print(types[i]);
}
}
}
}
}