/// <summary> /// Get the attributes from a attribute system /// </summary> /// <param name="attributeSystem"></param> /// <returns></returns> public static object[] GetAttributes(this uNode.IAttributeSystem attributeSystem) { var attribut = attributeSystem.Attributes; if (attribut == null) { return(new object[0]); } object[] att = new object[attribut.Count]; for (int i = 0; i < att.Length; i++) { att[i] = attribut[i].value?.Get(); } return(att); }
/// <summary> /// Get the attributes from a attribute system /// </summary> /// <param name="attributeSystem"></param> /// <returns></returns> public static object[] GetAttributes(this uNode.IAttributeSystem attributeSystem, Type attributeType) { var attribut = attributeSystem.Attributes; if (attribut == null) { return(new object[0]); } for (int i = 0; i < attribut.Count; i++) { if (attribut[i].type.startType == attributeType) { return(new object[] { attribut[i].value?.Get() }); } } return(new object[0]); }