1
0
mirror of https://github.com/Siccity/xNode.git synced 2026-03-26 22:49:02 +08:00

Support inherit attributes

This commit is contained in:
Sergi Tortosa 2019-02-19 22:38:22 +01:00
parent c306701853
commit 572f9d4893

View File

@ -25,7 +25,7 @@ namespace XNodeEditor {
public static bool GetAttrib<T>(object[] attribs, out T attribOut) where T : Attribute {
for (int i = 0; i < attribs.Length; i++) {
if (attribs[i].GetType() == typeof(T)) {
if (attribs[i] is T){
attribOut = attribs[i] as T;
return true;
}
@ -43,7 +43,7 @@ namespace XNodeEditor {
attribOut = null;
return false;
}
object[] attribs = field.GetCustomAttributes(typeof(T), false);
object[] attribs = field.GetCustomAttributes(typeof(T), true);
return GetAttrib(attribs, out attribOut);
}