public static void Init() { ActionTargets.lookup.Clear(); using (List <Type> .Enumerator enumerator = Actions.List.GetEnumerator()) { while (enumerator.MoveNext()) { Type current = enumerator.get_Current(); IEnumerable <Attribute> attributes = CustomAttributeHelpers.GetAttributes(current, typeof(ActionTarget)); using (IEnumerator <Attribute> enumerator2 = attributes.GetEnumerator()) { while (enumerator2.MoveNext()) { Attribute current2 = enumerator2.get_Current(); ActionTargets.AddActionTarget(current, (ActionTarget)current2); } } } } using (List <Type> .Enumerator enumerator3 = Actions.List.GetEnumerator()) { while (enumerator3.MoveNext()) { Type current3 = enumerator3.get_Current(); if (!ActionTargets.HasNoActionTargetsAttribute(current3) && !ActionTargets.HasActionTargets(current3)) { ActionTargets.GenerateActionTargets(current3); } } } }
private static void FindUIHintParameters(Type actionType, FieldInfo field) { IEnumerable <UIHintAttribute> attributes = CustomAttributeHelpers.GetAttributes <UIHintAttribute>(field); using (IEnumerator <UIHintAttribute> enumerator = attributes.GetEnumerator()) { while (enumerator.MoveNext()) { UIHintAttribute current = enumerator.get_Current(); UIHint hint = current.get_Hint(); UIHint uIHint = hint; if (uIHint == 6) { ActionTargets.AddActionTarget(actionType, new ActionTarget(typeof(AnimationClip), field.get_Name(), false)); } } } }
public static IEnumerable <T> GetAttributes <T>(Type type) where T : Attribute { return(CustomAttributeHelpers.GetAttributes <T>(type.GetCustomAttributes(true))); }
public static IEnumerable <T> GetAttributes <T>(FieldInfo field) where T : Attribute { return(CustomAttributeHelpers.GetAttributes <T>(field.GetCustomAttributes(true))); }
public static bool HasUIHint(object[] attributes, UIHint uiHintValue) { IEnumerable <UIHintAttribute> attributes2 = CustomAttributeHelpers.GetAttributes <UIHintAttribute>(attributes); return(Enumerable.Any <UIHintAttribute>(attributes2, (UIHintAttribute uiHint) => uiHint.get_Hint() == uiHintValue)); }