@@ -8,36 +8,36 @@ namespace UnityExplorer.UI
8
8
{
9
9
public class UISyntaxHighlight
10
10
{
11
- public const string Field_Static = "#8d8dc6" ;
12
- public const string Field_Instance = "#c266ff" ;
11
+ public const string FIELD_STATIC = "#8d8dc6" ;
12
+ public const string FIELD_INSTANCE = "#c266ff" ;
13
13
14
- public const string Method_Static = "#b55b02" ;
15
- public const string Method_Instance = "#ff8000" ;
14
+ public const string METHOD_STATIC = "#b55b02" ;
15
+ public const string METHOD_INSTANCE = "#ff8000" ;
16
16
17
- public const string Prop_Static = "#588075" ;
18
- public const string Prop_Instance = "#55a38e" ;
17
+ public const string PROP_STATIC = "#588075" ;
18
+ public const string PROP_INSTANCE = "#55a38e" ;
19
19
20
- public const string Class_Static = "#3a8d71" ;
21
- public const string Class_Instance = "#2df7b2" ;
20
+ public const string CLASS_STATIC = "#3a8d71" ;
21
+ public const string CLASS_INSTANCE = "#2df7b2" ;
22
22
23
- public const string Local = "#a6e9e9 " ;
23
+ public const string CLASS_STRUCT = "#0fba3a " ;
24
24
25
- public const string StructGreen = "#0fba3a " ;
25
+ public const string LOCAL_ARG = "#a6e9e9 " ;
26
26
27
- public static string Enum = "#92c470" ;
27
+ public static string CONST_VAR = "#92c470" ;
28
28
29
29
internal static readonly Color s_silver = new Color ( 0.66f , 0.66f , 0.66f ) ;
30
30
31
31
internal static string GetClassColor ( Type type )
32
32
{
33
33
if ( type . IsAbstract && type . IsSealed )
34
- return Class_Static ;
34
+ return CLASS_STATIC ;
35
35
else if ( type . IsEnum || type . IsGenericParameter )
36
- return Enum ;
36
+ return CONST_VAR ;
37
37
else if ( type . IsValueType )
38
- return StructGreen ;
38
+ return CLASS_STRUCT ;
39
39
else
40
- return Class_Instance ;
40
+ return CLASS_INSTANCE ;
41
41
}
42
42
43
43
public static string ParseFullSyntax ( Type type , bool includeNamespace , MemberInfo memberInfo = null )
@@ -49,7 +49,7 @@ public static string ParseFullSyntax(Type type, bool includeNamespace, MemberInf
49
49
50
50
if ( type . IsGenericParameter || ( type . HasElementType && type . GetElementType ( ) . IsGenericParameter ) )
51
51
{
52
- ret = $ "<color={ Enum } >{ type . Name } </color>";
52
+ ret = $ "<color={ CONST_VAR } >{ type . Name } </color>";
53
53
}
54
54
else
55
55
{
@@ -134,7 +134,7 @@ private static string ParseGenericArgs(Type[] gArgs, bool allGeneric = false)
134
134
135
135
if ( allGeneric )
136
136
{
137
- args += $ "<color={ Enum } >{ arg . Name } </color>";
137
+ args += $ "<color={ CONST_VAR } >{ arg . Name } </color>";
138
138
continue ;
139
139
}
140
140
@@ -153,30 +153,30 @@ private static string GetMemberInfoColor(MemberInfo memberInfo, out bool isStati
153
153
if ( fi . IsStatic )
154
154
{
155
155
isStatic = true ;
156
- memberColor = Field_Static ;
156
+ memberColor = FIELD_STATIC ;
157
157
}
158
158
else
159
- memberColor = Field_Instance ;
159
+ memberColor = FIELD_INSTANCE ;
160
160
}
161
161
else if ( memberInfo is MethodInfo mi )
162
162
{
163
163
if ( mi . IsStatic )
164
164
{
165
165
isStatic = true ;
166
- memberColor = Method_Static ;
166
+ memberColor = METHOD_STATIC ;
167
167
}
168
168
else
169
- memberColor = Method_Instance ;
169
+ memberColor = METHOD_INSTANCE ;
170
170
}
171
171
else if ( memberInfo is PropertyInfo pi )
172
172
{
173
173
if ( pi . GetAccessors ( true ) [ 0 ] . IsStatic )
174
174
{
175
175
isStatic = true ;
176
- memberColor = Prop_Static ;
176
+ memberColor = PROP_STATIC ;
177
177
}
178
178
else
179
- memberColor = Prop_Instance ;
179
+ memberColor = PROP_INSTANCE ;
180
180
}
181
181
return memberColor ;
182
182
}
0 commit comments